Skip to content

hanjos/nexus

Repository files navigation

A Go library to pull data from a Sonatype Nexus instance.

TravisCI GoDoc

How?

go get should see you through:

go get sbrubbles.org/go/nexus

And therefore import:

package main

import (
  "fmt"
  "sbrubbles.org/go/nexus"
  "sbrubbles.org/go/nexus/credentials"
  "sbrubbles.org/go/nexus/search"
  "reflect"
)

func main() {
  n := nexus.New("http://nexus.somewhere.com", credentials.BasicAuth("username", "password"))

  artifacts, err := n.Artifacts(
    search.InRepository{
      "shamalamadingdong",
      search.ByKeyword("org.sbrubbles*")})

  if err != nil {
    fmt.Printf("%v: %v", reflect.TypeOf(err), err)
  }

  for _, a := range artifacts {
    fmt.Println(a)
  }
}

Why?

Nexus has a large REST API, but some information isn't readily available, requiring several API calls and some mashing up to produce.

And it was a good excuse to try Go out :)

License

MIT License. See LICENSE for the gory details.

About

Pulls data from a Sonatype Nexus instance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages