Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Check(ctx context.Context, check string, image reference.Canonical) (voucher.Response, error)
- func (c *Client) CopyURL() *url.URL
- func (c *Client) SetBasicAuth(username, password string)
- func (c *Client) Verify(ctx context.Context, check string, image reference.Canonical) (voucher.Response, error)
- type Option
Constants ¶
const DefaultUserAgent = "voucher-client/2"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the Voucher API.
func NewAuthClient ¶ added in v2.7.0
NewAuthClient creates a new auth Client set to connect to the passed hostname using tokens. Deprecated: use NewClientContext and the WithIDTokenAuth option instead
func NewClientContext ¶ added in v2.7.0
NewClientContext creates a new Client set to connect to the passed hostname.
func (*Client) Check ¶
func (c *Client) Check(ctx context.Context, check string, image reference.Canonical) (voucher.Response, error)
Check executes a request to a Voucher server, to the appropriate check URI, and with the passed reference.Canonical. Returns a voucher.Response and an error.
func (*Client) SetBasicAuth ¶
SetBasicAuth adds the username and password to the Client struct Deprecated: use the WithBasicAuth option instead
type Option ¶ added in v2.7.0
func WithBasicAuth ¶ added in v2.7.0
WithBasicAuth sets the username and password to use for the client.
func WithDefaultIDTokenAuth ¶ added in v2.7.0
func WithDefaultIDTokenAuth() Option
WithDefaultIDTokenAuth configures the client to use Google's default token.
func WithHTTPClient ¶ added in v2.7.0
WithHTTPClient customizes the http.Client used by the client. Customize the client's Transport to do arbitrary authentication.
func WithIDTokenAuth ¶ added in v2.7.0
func WithIDTokenAuth() Option
WithIDTokenAuth configures the client to use an ID token.
func WithUserAgent ¶ added in v2.7.0
WithUserAgent sets the User-Agent header for the client.