Documentation
¶
Overview ¶
Package client provides a rest client to talk to the Trusty API.
Index ¶
- Variables
- type Options
- type Trusty
- func (t *Trusty) GroupReport(_ context.Context, deps []*types.Dependency) ([]*types.Reply, error)
- func (t *Trusty) PackageEndpoint(dep *types.Dependency) (string, error)
- func (t *Trusty) PurlEndpoint(purl string) (string, error)
- func (t *Trusty) PurlToDependency(purlString string) (*types.Dependency, error)
- func (_ *Trusty) PurlToEcosystem(purl string) types.Ecosystem
- func (t *Trusty) Report(_ context.Context, dep *types.Dependency) (*types.Reply, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{
Workers: 2,
BaseURL: defaultEndpoint,
}
DefaultOptions is the default Trusty client options set
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
HttpClient netClient
// Workers is the number of parallel request the client makes to the API
Workers int
// BaseURL of the Trusty API
BaseURL string
}
Options configures the Trusty API client
type Trusty ¶
type Trusty struct {
Options Options
}
Trusty is the main trusty client
func NewWithOptions ¶
NewWithOptions returns a new client with the dspecified options set
func (*Trusty) GroupReport ¶ added in v0.2.0
GroupReport queries the Trusty API in parallel for a group of dependencies.
func (*Trusty) PackageEndpoint ¶ added in v0.2.0
func (t *Trusty) PackageEndpoint(dep *types.Dependency) (string, error)
PackageEndpoint takes a dependency and returns the Trusty endpoint to query data about it.
func (*Trusty) PurlEndpoint ¶ added in v0.2.0
PurlEndpoint returns the API endpoint url to query for data about a purl
func (*Trusty) PurlToDependency ¶ added in v0.2.0
func (t *Trusty) PurlToDependency(purlString string) (*types.Dependency, error)
PurlToDependency takes a string with a package url
func (*Trusty) PurlToEcosystem ¶ added in v0.2.0
PurlToEcosystem returns a trusty ecosystem constant from a Package URL's type
Click to show internal directories.
Click to hide internal directories.