Documentation ¶
Overview ¶
Package ociclient contains the OCI client interface and implementation.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Catalog(ctx context.Context, reg name.Registry) ([]string, error)
- func (c *Client) Head(ref name.Reference) (*v1.Descriptor, error)
- func (c *Client) List(ref name.Repository) ([]string, error)
- func (c *Client) PullChart(opts ImageOptions) error
- func (c *Client) PullImage(ref name.Reference) (v1.Image, error)
- func (c *Client) ValidateImage(image v1.Image, vType v1alpha1.ValidationType) error
- func (c *Client) VerifySignature(ctx context.Context, ref name.Reference) ([]string, []error)
- func (c *Client) WriteLayer(layer v1.Layer, path string, opts ImageOptions) error
- type ImageOptions
- type Option
- func WithAnonymousAuth() Option
- func WithBasicAuth(username, password string) Option
- func WithMultiAuth(keychain []authn.Keychain) Option
- func WithTLSConfig(insecureSkipTLSVerify bool, caCert, caFile string) Option
- func WithVerificationPublicKeys(publicKeys [][]byte) Option
- func WithVerificationTimeout(timeout time.Duration) Option
Constants ¶
const ( // Scheme is the URI scheme for an OCI registry. Scheme = "oci://" // VerificationTimeout is the timeout for verifying the authenticity of an image. VerificationTimeout = 60 * time.Second )
Variables ¶
var ( // ErrNoPublicKeys is the error message for when no public keys are provided for signature verification. ErrNoPublicKeys = errors.New("no public keys provided for signature verification") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an interface for interacting with an OCI registry.
func NewOCIClient ¶
NewOCIClient creates a new OCI client with the given options.
func (*Client) List ¶
func (c *Client) List(ref name.Repository) ([]string, error)
List returns a list of tags for the given repository.
func (*Client) PullChart ¶
func (c *Client) PullChart(opts ImageOptions) error
PullChart pulls a Helm chart from the given ImageOptions.
func (*Client) ValidateImage ¶
ValidateImage validates the given image.
func (*Client) VerifySignature ¶
VerifySignature verifies the authenticity of the given image reference URL using the provided public keys.
func (*Client) WriteLayer ¶
WriteLayer writes a layer to the filesystem.
type ImageOptions ¶
ImageOptions defines the options for pulling an image.
type Option ¶
type Option func(*Client)
Option is a functional option for configuring the OCI client.
func WithAnonymousAuth ¶
func WithAnonymousAuth() Option
WithAnonymousAuth configures the OCI client with anonymous authentication.
func WithBasicAuth ¶
WithBasicAuth configures the OCI client with basic authentication.
func WithMultiAuth ¶
WithMultiAuth configures the OCI client with multiple authentication keychains.
func WithTLSConfig ¶
WithTLSConfig configures the OCI client with the given TLS options.
func WithVerificationPublicKeys ¶
WithVerificationPublicKeys configures the OCI client with the given public keys for signature verification.
func WithVerificationTimeout ¶
WithVerificationTimeout configures the OCI client with the given verification timeout.