Documentation
¶
Index ¶
- Constants
- Variables
- func NewReferenceError(reference string, err error) error
- func NewRegistryError(reference, code, message string, err error) error
- type Client
- func (c *Client) BearerToken(ctx context.Context, reference string) (string, error)
- func (c *Client) BlobURL(reference string, digest v1.Hash) (string, error)
- func (c *Client) Model(ctx context.Context, reference string) (types.ModelArtifact, error)
- func (c *Client) NewTarget(tag string) (*Target, error)
- type ClientOption
- type Error
- type ReferenceError
- type Target
Constants ¶
View Source
const (
DefaultUserAgent = "model-distribution"
)
Variables ¶
View Source
var ( ErrInvalidReference = errors.New("invalid model reference") ErrModelNotFound = errors.New("model not found") ErrUnsupportedMediaType = errors.New(fmt.Sprintf( "client supports only models of type %q and older - try upgrading", types.MediaTypeModelConfigV01, )) )
View Source
var (
DefaultTransport = remote.DefaultTransport
)
Functions ¶
func NewReferenceError ¶
NewReferenceError creates a new ReferenceError
func NewRegistryError ¶
NewRegistryError creates a new Error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
func (*Client) BearerToken ¶
type ClientOption ¶
type ClientOption func(*Client)
func WithAuthConfig ¶
func WithAuthConfig(username, password string) ClientOption
func WithTransport ¶
func WithTransport(transport http.RoundTripper) ClientOption
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
type Error ¶
type Error struct {
Reference string
// Code should be one of error codes defined in the distribution spec
// (see https://github.com/opencontainers/distribution-spec/blob/583e014d15418d839d67f68152bc2c83821770e0/spec.md#error-codes)
Code string
Message string
Err error
}
Error represents an error returned by an OCI registry
type ReferenceError ¶
ReferenceError represents an error related to an invalid model reference
func (*ReferenceError) Error ¶
func (e *ReferenceError) Error() string
func (*ReferenceError) Is ¶
func (e *ReferenceError) Is(target error) bool
Is implements error matching for ReferenceError
func (*ReferenceError) Unwrap ¶
func (e *ReferenceError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.