Documentation ¶
Index ¶
- Constants
- Variables
- func GetFormats() []string
- func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler
- func RegisterFormat(f accessobj.FormatHandler) *formatHandler
- type ComponentAccess
- func (c *ComponentAccess) AddVersion(access cpi.ComponentVersionAccess) error
- func (c *ComponentAccess) Close() error
- func (c *ComponentAccess) GetContext() cpi.Context
- func (c *ComponentAccess) GetName() string
- func (c *ComponentAccess) ListVersions() ([]string, error)
- func (c *ComponentAccess) LookupVersion(ref string) (cpi.ComponentVersionAccess, error)
- func (c *ComponentAccess) NewVersion(version string, overrides ...bool) (cpi.ComponentVersionAccess, error)
- type ComponentArchive
- func (c *ComponentArchive) AccessMethod(a cpi.AccessSpec) (cpi.AccessMethod, error)
- func (c *ComponentArchive) AddBlobFor(storagectx cpi.StorageContext, blob cpi.BlobAccess, refName string, ...) (cpi.AccessSpec, error)
- func (c *ComponentArchive) AsRepository() cpi.Repository
- func (c *ComponentArchive) Close() error
- func (c *ComponentArchive) ComponentAccess() cpi.ComponentAccess
- func (c *ComponentArchive) GetBlobData(name string) (cpi.DataAccess, error)
- func (c *ComponentArchive) GetContext() cpi.Context
- func (c *ComponentArchive) GetDescriptor() *compdesc.ComponentDescriptor
- func (c *ComponentArchive) GetStorageContext(cv cpi.ComponentVersionAccess) cpi.StorageContext
- func (c *ComponentArchive) Repository() cpi.Repository
- func (c *ComponentArchive) SetName(n string)
- func (c *ComponentArchive) SetVersion(v string)
- func (c *ComponentArchive) Update() error
- type FormatHandler
- type Object
- type Repository
- func (r *Repository) Close() error
- func (r *Repository) ComponentLister() cpi.ComponentLister
- func (r *Repository) ExistsComponentVersion(name string, ref string) (bool, error)
- func (r *Repository) Get() *ComponentArchive
- func (r *Repository) GetComponents(prefix string, closure bool) ([]string, error)
- func (r *Repository) GetContext() cpi.Context
- func (r *Repository) GetSpecification() cpi.RepositorySpec
- func (r *Repository) LookupComponent(name string) (cpi.ComponentAccess, error)
- func (r *Repository) LookupComponentVersion(name string, version string) (cpi.ComponentVersionAccess, error)
- func (r *Repository) NumComponents(prefix string) (int, error)
- func (r *Repository) Open() (*ComponentArchive, error)
- type RepositorySpec
- type StateHandler
Constants ¶
View Source
const ( Type = "ComponentArchive" TypeV1 = Type + runtime.VersionSeparator + "v1" )
View Source
const BlobsDirectoryName = "blobs"
BlobsDirectoryName is the name of the blob directory in the tar.
View Source
const ComponentDescriptorFileName = compdesc.ComponentDescriptorFileName
ComponentDescriptorFileName is the name of the component-descriptor file.
Variables ¶
View Source
var ( FormatDirectory = RegisterFormat(accessobj.FormatDirectory) FormatTAR = RegisterFormat(accessobj.FormatTAR) FormatTGZ = RegisterFormat(accessobj.FormatTGZ) )
Functions ¶
func GetFormats ¶
func GetFormats() []string
func NewStateHandler ¶
func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler
func RegisterFormat ¶
func RegisterFormat(f accessobj.FormatHandler) *formatHandler
Types ¶
type ComponentAccess ¶
type ComponentAccess struct {
// contains filtered or unexported fields
}
func (*ComponentAccess) AddVersion ¶
func (c *ComponentAccess) AddVersion(access cpi.ComponentVersionAccess) error
func (*ComponentAccess) Close ¶
func (c *ComponentAccess) Close() error
func (*ComponentAccess) GetContext ¶
func (c *ComponentAccess) GetContext() cpi.Context
func (*ComponentAccess) GetName ¶
func (c *ComponentAccess) GetName() string
func (*ComponentAccess) ListVersions ¶
func (c *ComponentAccess) ListVersions() ([]string, error)
func (*ComponentAccess) LookupVersion ¶
func (c *ComponentAccess) LookupVersion(ref string) (cpi.ComponentVersionAccess, error)
func (*ComponentAccess) NewVersion ¶
func (c *ComponentAccess) NewVersion(version string, overrides ...bool) (cpi.ComponentVersionAccess, error)
type ComponentArchive ¶
type ComponentArchive struct { *support.ComponentVersionAccess // contains filtered or unexported fields }
ComponentArchive is the go representation for a component artefact.
func New ¶
func New(ctx cpi.Context, acc accessobj.AccessMode, fs vfs.FileSystem, setup accessobj.Setup, closer accessobj.Closer, mode vfs.FileMode) (*ComponentArchive, error)
New returns a new representation based element.
func (*ComponentArchive) AccessMethod ¶
func (c *ComponentArchive) AccessMethod(a cpi.AccessSpec) (cpi.AccessMethod, error)
func (*ComponentArchive) AddBlobFor ¶
func (c *ComponentArchive) AddBlobFor(storagectx cpi.StorageContext, blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error)
func (*ComponentArchive) AsRepository ¶
func (c *ComponentArchive) AsRepository() cpi.Repository
func (*ComponentArchive) Close ¶
func (c *ComponentArchive) Close() error
func (*ComponentArchive) ComponentAccess ¶
func (c *ComponentArchive) ComponentAccess() cpi.ComponentAccess
func (*ComponentArchive) GetBlobData ¶
func (c *ComponentArchive) GetBlobData(name string) (cpi.DataAccess, error)
func (*ComponentArchive) GetContext ¶
func (c *ComponentArchive) GetContext() cpi.Context
func (*ComponentArchive) GetDescriptor ¶
func (c *ComponentArchive) GetDescriptor() *compdesc.ComponentDescriptor
func (*ComponentArchive) GetStorageContext ¶
func (c *ComponentArchive) GetStorageContext(cv cpi.ComponentVersionAccess) cpi.StorageContext
func (*ComponentArchive) Repository ¶
func (c *ComponentArchive) Repository() cpi.Repository
func (*ComponentArchive) SetName ¶
func (c *ComponentArchive) SetName(n string)
func (*ComponentArchive) SetVersion ¶
func (c *ComponentArchive) SetVersion(v string)
func (*ComponentArchive) Update ¶
func (c *ComponentArchive) Update() error
type FormatHandler ¶
type FormatHandler interface { accessio.Option Format() accessio.FileFormat Open(ctx cpi.Context, acc accessobj.AccessMode, path string, opts accessio.Options) (*Object, error) Create(ctx cpi.Context, 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
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(ctx cpi.Context, s *RepositorySpec) (*Repository, error)
func (*Repository) Close ¶
func (r *Repository) Close() error
func (*Repository) ComponentLister ¶
func (r *Repository) ComponentLister() cpi.ComponentLister
func (*Repository) ExistsComponentVersion ¶
func (r *Repository) ExistsComponentVersion(name string, ref string) (bool, error)
func (*Repository) Get ¶
func (r *Repository) Get() *ComponentArchive
func (*Repository) GetComponents ¶
func (r *Repository) GetComponents(prefix string, closure bool) ([]string, error)
func (*Repository) GetContext ¶
func (r *Repository) GetContext() cpi.Context
func (*Repository) GetSpecification ¶
func (r *Repository) GetSpecification() cpi.RepositorySpec
func (*Repository) LookupComponent ¶
func (r *Repository) LookupComponent(name string) (cpi.ComponentAccess, error)
func (*Repository) LookupComponentVersion ¶
func (r *Repository) LookupComponentVersion(name string, version string) (cpi.ComponentVersionAccess, error)
func (*Repository) NumComponents ¶
func (r *Repository) NumComponents(prefix string) (int, error)
func (*Repository) Open ¶
func (r *Repository) Open() (*ComponentArchive, error)
type RepositorySpec ¶
type RepositorySpec struct { runtime.ObjectVersionedType `json:",inline"` accessio.Options `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"` }
func NewRepositorySpec ¶
func NewRepositorySpec(acc accessobj.AccessMode, filePath string, opts ...accessio.Option) (*RepositorySpec, error)
NewRepositorySpec creates a new RepositorySpec.
func (*RepositorySpec) AsUniformSpec ¶
func (a *RepositorySpec) AsUniformSpec(cpi.Context) cpi.UniformRepositorySpec
func (*RepositorySpec) GetType ¶
func (a *RepositorySpec) GetType() string
func (*RepositorySpec) IsIntermediate ¶
func (a *RepositorySpec) IsIntermediate() bool
func (*RepositorySpec) Repository ¶
func (a *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)
type StateHandler ¶
type StateHandler struct {
// contains filtered or unexported fields
}
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{}
Click to show internal directories.
Click to hide internal directories.