Documentation ¶
Index ¶
- Constants
- Variables
- type HTTP
- 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]uuid.UUID, error)
- func (s HTTP) State(ctx context.Context) (string, error)
- func (c HTTP) UpdateDiff(ctx context.Context, prev, cur uuid.UUID) (*driver.UpdateDiff, 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 ¶
var ErrUnchanged = errors.New("response unchanged from last call")
ErrUnchanged is returned from LatestUpdateOperations if there have been no new update operations since the last call.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP = *httpClient
HTTP implements access to clair interfaces over HTTP
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 ¶
LatestUpdateOperations returns a map of updater name to ref of its latest update.
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.
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.