Documentation ¶
Index ¶
- Constants
- Variables
- func GetFormats() []string
- func MapReference(ctx cpi.Context, u *cpi.UniformRepositorySpec) (cpi.RepositorySpec, error)
- func NewNamespace(repo *RepositoryImpl, name string) (cpi.NamespaceAccess, error)
- func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler
- func SupportedFormats() []accessio.FileFormat
- type FormatHandler
- type Object
- func Create(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, ...) (*Object, error)
- func Open(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, ...) (*Object, error)
- func OpenFromBlob(ctx cpi.ContextProvider, acc accessobj.AccessMode, blob accessio.BlobAccess, ...) (*Object, error)
- type Repository
- type RepositoryImpl
- func (r *RepositoryImpl) Close() error
- func (r *RepositoryImpl) ExistsArtifact(name string, tag string) (bool, error)
- func (r *RepositoryImpl) GetNamespaces(prefix string, closure bool) ([]string, error)
- func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec
- func (r *RepositoryImpl) IsReadOnly() bool
- func (r *RepositoryImpl) LookupArtifact(name string, ref string) (acc cpi.ArtifactAccess, err error)
- func (r *RepositoryImpl) LookupNamespace(name string) (cpi.NamespaceAccess, error)
- func (r *RepositoryImpl) NamespaceLister() cpi.NamespaceLister
- func (r *RepositoryImpl) NumNamespaces(prefix string) (int, error)
- func (r *RepositoryImpl) Update() error
- func (r *RepositoryImpl) Write(path string, mode vfs.FileMode, opts ...accessio.Option) error
- type RepositorySpec
- func (a *RepositorySpec) GetType() string
- func (a *RepositorySpec) IsIntermediate() bool
- func (s *RepositorySpec) Name() string
- func (a *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)
- func (s *RepositorySpec) UniformRepositorySpec() *cpi.UniformRepositorySpec
- type StateHandler
Constants ¶
View Source
const ( ArtifactIndexFileName = format.ArtifactIndexFileName BlobsDirectoryName = format.BlobsDirectoryName )
View Source
const ( Type = cpi.CommonTransportFormat TypeV1 = Type + runtime.VersionSeparator + "v1" )
Variables ¶
View Source
var ( FormatDirectory = RegisterFormat(accessobj.FormatDirectory) FormatTAR = RegisterFormat(accessobj.FormatTAR) FormatTGZ = RegisterFormat(accessobj.FormatTGZ) )
Functions ¶
func GetFormats ¶
func GetFormats() []string
func MapReference ¶
func MapReference(ctx cpi.Context, u *cpi.UniformRepositorySpec) (cpi.RepositorySpec, error)
func NewNamespace ¶
func NewNamespace(repo *RepositoryImpl, name string) (cpi.NamespaceAccess, error)
func NewStateHandler ¶
func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler
func SupportedFormats ¶
func SupportedFormats() []accessio.FileFormat
Types ¶
type FormatHandler ¶
type FormatHandler interface { accessio.Option Format() accessio.FileFormat Open(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, opts accessio.Options) (*Object, error) Create(ctx cpi.ContextProvider, path string, opts accessio.Options, mode vfs.FileMode) (*Object, error) Write(obj *Object, path string, opts accessio.Options, mode vfs.FileMode) error }
func GetFormat ¶
func GetFormat(name accessio.FileFormat) FormatHandler
func RegisterFormat ¶
func RegisterFormat(f accessobj.FormatHandler) FormatHandler
type Object ¶
type Object = Repository
func OpenFromBlob ¶
func OpenFromBlob(ctx cpi.ContextProvider, acc accessobj.AccessMode, blob accessio.BlobAccess, opts ...accessio.Option) (*Object, error)
type Repository ¶
type Repository struct { cpi.Repository // contains filtered or unexported fields }
func New ¶
func New(ctx cpi.Context, spec *RepositorySpec, setup accessobj.Setup, closer accessobj.Closer, mode vfs.FileMode) (*Repository, error)
New returns a new representation based repository.
func (*Repository) Close ¶
func (r *Repository) Close() error
type RepositoryImpl ¶
type RepositoryImpl struct { cpi.RepositoryImplBase // contains filtered or unexported fields }
RepositoryImpl is closed, if all views are released.
func (*RepositoryImpl) Close ¶
func (r *RepositoryImpl) Close() error
func (*RepositoryImpl) ExistsArtifact ¶
func (r *RepositoryImpl) ExistsArtifact(name string, tag string) (bool, error)
func (*RepositoryImpl) GetNamespaces ¶
func (r *RepositoryImpl) GetNamespaces(prefix string, closure bool) ([]string, error)
func (*RepositoryImpl) GetSpecification ¶
func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec
func (*RepositoryImpl) IsReadOnly ¶
func (r *RepositoryImpl) IsReadOnly() bool
func (*RepositoryImpl) LookupArtifact ¶
func (r *RepositoryImpl) LookupArtifact(name string, ref string) (acc cpi.ArtifactAccess, err error)
func (*RepositoryImpl) LookupNamespace ¶
func (r *RepositoryImpl) LookupNamespace(name string) (cpi.NamespaceAccess, error)
func (*RepositoryImpl) NamespaceLister ¶
func (r *RepositoryImpl) NamespaceLister() cpi.NamespaceLister
func (*RepositoryImpl) NumNamespaces ¶
func (r *RepositoryImpl) NumNamespaces(prefix string) (int, error)
func (*RepositoryImpl) Update ¶
func (r *RepositoryImpl) Update() error
type RepositorySpec ¶
type RepositorySpec struct { runtime.ObjectVersionedType `json:",inline"` accessio.StandardOptions `json:",inline"` // FileFormat is the format of the repository file FilePath string `json:"filePath"` // AccessMode can be set to request readonly access or creation AccessMode accessobj.AccessMode `json:"accessMode,omitempty"` }
RepositorySpec describes an OCI registry interface backed by an oci registry.
func NewRepositorySpec ¶
func NewRepositorySpec(mode accessobj.AccessMode, filePath string, opts ...accessio.Option) (*RepositorySpec, error)
NewRepositorySpec creates a new RepositorySpec.
func (*RepositorySpec) GetType ¶
func (a *RepositorySpec) GetType() string
func (*RepositorySpec) IsIntermediate ¶
func (a *RepositorySpec) IsIntermediate() bool
func (*RepositorySpec) Name ¶
func (s *RepositorySpec) Name() string
func (*RepositorySpec) Repository ¶
func (a *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)
func (*RepositorySpec) UniformRepositorySpec ¶
func (s *RepositorySpec) UniformRepositorySpec() *cpi.UniformRepositorySpec
type StateHandler ¶
type StateHandler struct{}
func (StateHandler) Decode ¶
func (i StateHandler) Decode(data []byte) (interface{}, error)
func (StateHandler) Encode ¶
func (i StateHandler) Encode(d interface{}) ([]byte, error)
func (StateHandler) Equivalent ¶
func (i StateHandler) Equivalent(a, b interface{}) bool
func (StateHandler) Initial ¶
func (i StateHandler) Initial() interface{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.