Documentation ¶
Index ¶
- Constants
- type HTTP
- func (s *HTTP) AffectedManifests(ctx context.Context, v []claircore.Vulnerability) (claircore.AffectedManifests, error)
- func (c *HTTP) DeleteUpdateOperations(ctx context.Context, ref ...uuid.UUID) error
- func (s *HTTP) Index(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error)
- func (s *HTTP) IndexReport(ctx context.Context, manifest claircore.Digest) (*claircore.IndexReport, bool, error)
- func (c *HTTP) LatestUpdateOperation(_ context.Context) (uuid.UUID, error)
- func (c *HTTP) LatestUpdateOperations(ctx context.Context) (map[string][]driver.UpdateOperation, error)
- func (c *HTTP) Scan(ctx context.Context, ir *claircore.IndexReport) (*claircore.VulnerabilityReport, error)
- func (s *HTTP) State(ctx context.Context) (string, error)
- func (c *HTTP) UpdateDiff(ctx context.Context, prev, cur uuid.UUID) (*driver.UpdateDiff, error)
- func (c *HTTP) UpdateOperations(ctx context.Context, updaters ...string) (map[string][]driver.UpdateOperation, error)
- type Option
Constants ¶
const DefaultAddr = `http://clair:6060/`
DefaultAddr is used if the WithAddr Option isn't provided to New.
This uses the default service port, and should just work if a containerized deployment has a service configured that hairpins and routes correctly.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP implements access to clair interfaces over HTTP
func (*HTTP) AffectedManifests ¶
func (s *HTTP) AffectedManifests(ctx context.Context, v []claircore.Vulnerability) (claircore.AffectedManifests, error)
func (*HTTP) DeleteUpdateOperations ¶
DeleteUpdateOperations attempts to delete the referenced update operations.
func (*HTTP) Index ¶
func (s *HTTP) Index(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error)
Index receives a Manifest and returns a IndexReport providing the indexed items in the resulting image.
Index blocks until completion. An error is returned if the index operation could not start. If an error occurs during the index operation the error will be preset on the IndexReport.Err field of the returned IndexReport.
func (*HTTP) IndexReport ¶
func (s *HTTP) IndexReport(ctx context.Context, manifest claircore.Digest) (*claircore.IndexReport, bool, error)
IndexReport retrieves a IndexReport given a manifest hash string
func (*HTTP) LatestUpdateOperation ¶
LatestUpdateOperation shouldn't be used by client code and is implemented only to satisfy the matcher.Differ interface.
func (*HTTP) LatestUpdateOperations ¶
func (c *HTTP) LatestUpdateOperations(ctx context.Context) (map[string][]driver.UpdateOperation, error)
LatestUpdateOperations returns the most recent UpdateOperation per updater.
func (*HTTP) Scan ¶
func (c *HTTP) Scan(ctx context.Context, ir *claircore.IndexReport) (*claircore.VulnerabilityReport, error)
func (*HTTP) UpdateDiff ¶
UpdateDiff reports the diff of two update operations, identified by the provided refs.
"Prev" may be passed uuid.Nil if the client's last known state has been forgotten by the server.
func (*HTTP) UpdateOperations ¶
func (c *HTTP) UpdateOperations(ctx context.Context, updaters ...string) (map[string][]driver.UpdateOperation, error)
UpdateOperations returns all the known UpdateOperations per updater.
type Option ¶
Option sets an option on an HTTP.
func WithAddr ¶
WithAddr sets the address to talk to.
The client doesn't support providing multiple addresses, so the provided address should most likely have some form of load balancing or routing.
The provided URL should not include the `/api/v1` prefix.
func WithClient ¶
WithClient sets the http.Client used for requests.
If WithClient is not supplied to NewHTTP, http.DefaultClient is used.