Documentation
¶
Index ¶
- func IsInsecureRegistry(target string, insecureList []string) bool
- type AuthProvider
- func (a *AuthProvider) AddCredential(registry, username, password string)
- func (a *AuthProvider) GetCredentials(registry string) (*Credentials, error)
- func (a *AuthProvider) LoadCredentials(creds []Credentials)
- func (a *AuthProvider) LoadDockerConfig() error
- func (a *AuthProvider) RefreshToken(ctx context.Context, registry string) error
- type Client
- func (c *Client) CopyDescriptor(ctx context.Context, reference string, desc ocispec.Descriptor, dest io.Writer) error
- func (c *Client) FetchDescriptor(ctx context.Context, reference string, desc ocispec.Descriptor) ([]byte, error)
- func (c *Client) GetManifest(ctx context.Context, reference string) ([]byte, ocispec.Descriptor, error)
- func (c *Client) List(ctx context.Context, repository string) ([]string, error)
- func (c *Client) Pull(ctx context.Context, reference string, dest io.Writer) error
- func (c *Client) Push(ctx context.Context, reference string, content io.Reader, contentType string) error
- type ClientOption
- type Credentials
- type DockerAuth
- type DockerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInsecureRegistry ¶ added in v1.2.0
IsInsecureRegistry returns true when the target registry should be accessed over plain HTTP. It compares the normalized registry host (without scheme or trailing slashes) against the configured insecure registry list.
Types ¶
type AuthProvider ¶
type AuthProvider struct {
// contains filtered or unexported fields
}
AuthProvider manages authentication for registries
func NewAuthProvider ¶
func NewAuthProvider() *AuthProvider
NewAuthProvider creates a new authentication provider
func (*AuthProvider) AddCredential ¶
func (a *AuthProvider) AddCredential(registry, username, password string)
AddCredential adds a credential for a registry
func (*AuthProvider) GetCredentials ¶
func (a *AuthProvider) GetCredentials(registry string) (*Credentials, error)
GetCredentials returns credentials for a specific registry
func (*AuthProvider) LoadCredentials ¶
func (a *AuthProvider) LoadCredentials(creds []Credentials)
LoadCredentials loads credentials from DS configuration
func (*AuthProvider) LoadDockerConfig ¶
func (a *AuthProvider) LoadDockerConfig() error
LoadDockerConfig loads credentials from ~/.docker/config.json
func (*AuthProvider) RefreshToken ¶
func (a *AuthProvider) RefreshToken(ctx context.Context, registry string) error
RefreshToken refreshes an expired token (placeholder for future implementation)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an OCI registry client
func NewClient ¶
func NewClient(registry string, authProvider *AuthProvider, opts ...ClientOption) (*Client, error)
NewClient creates a new OCI registry client
func (*Client) CopyDescriptor ¶ added in v1.2.0
func (c *Client) CopyDescriptor(ctx context.Context, reference string, desc ocispec.Descriptor, dest io.Writer) error
CopyDescriptor streams descriptor content into the provided writer.
func (*Client) FetchDescriptor ¶ added in v1.2.0
func (c *Client) FetchDescriptor(ctx context.Context, reference string, desc ocispec.Descriptor) ([]byte, error)
FetchDescriptor retrieves raw content for the provided descriptor referenced by the given base reference.
func (*Client) GetManifest ¶
func (c *Client) GetManifest(ctx context.Context, reference string) ([]byte, ocispec.Descriptor, error)
GetManifest fetches the manifest for an artifact
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a functional option for configuring the client
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client
func WithInsecure ¶
func WithInsecure(insecure bool) ClientOption
WithInsecure enables insecure (HTTP) registry connections
type Credentials ¶
Credentials represents registry credentials
type DockerAuth ¶
type DockerAuth struct {
Auth string `json:"auth,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
DockerAuth represents authentication for a registry
type DockerConfig ¶
type DockerConfig struct {
Auths map[string]DockerAuth `json:"auths"`
}
DockerConfig represents the Docker config.json structure