Documentation ¶
Index ¶
- Constants
- type HTTP
- func (s *HTTP) AffectedManifests(ctx context.Context, v []claircore.Vulnerability) (*claircore.AffectedManifests, error)
- func (s *HTTP) DeleteManifests(ctx context.Context, d ...claircore.Digest) ([]claircore.Digest, error)
- func (c *HTTP) DeleteUpdateOperations(ctx context.Context, ref ...uuid.UUID) (int64, 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) Initialized(_ context.Context) (bool, error)
- func (c *HTTP) LatestUpdateOperation(_ context.Context, _ driver.UpdateKind) (uuid.UUID, error)
- func (c *HTTP) LatestUpdateOperations(ctx context.Context, k driver.UpdateKind) (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, k driver.UpdateKind, updaters ...string) (map[string][]driver.UpdateOperation, error)
- type Option
- type Signer
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) DeleteManifests ¶ added in v4.4.0
func (s *HTTP) DeleteManifests(ctx context.Context, d ...claircore.Digest) ([]claircore.Digest, error)
DeleteManifests deletes the specified manifests.
Passing a digest of an unknown manifest is not an 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) Initialized ¶ added in v4.1.0
Initialized is present to fulfill the interface, but isn't exposed as part of the HTTP API. This method is stubbed out.
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, k driver.UpdateKind) (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, k driver.UpdateKind, 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.