Documentation ¶
Index ¶
- Constants
- Variables
- func ResolveName(desc ocispec.Descriptor) (string, bool)
- type FileStore
- func (s *FileStore) Add(name, mediaType, path string) (ocispec.Descriptor, error)
- func (s *FileStore) Close() error
- func (s *FileStore) MapPath(name, path string) string
- func (s *FileStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error)
- func (s *FileStore) ResolvePath(name string) string
- func (s *FileStore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error)
- type Memorystore
- func (s *Memorystore) Add(name, mediaType string, content []byte) ocispec.Descriptor
- func (s *Memorystore) Get(desc ocispec.Descriptor) (ocispec.Descriptor, []byte, bool)
- func (s *Memorystore) GetByName(name string) (ocispec.Descriptor, []byte, bool)
- func (s *Memorystore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error)
- func (s *Memorystore) Set(desc ocispec.Descriptor, content []byte)
- func (s *Memorystore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error)
Constants ¶
View Source
const ( // DefaultBlobMediaType specifies the default blob media type DefaultBlobMediaType = ocispec.MediaTypeImageLayer // DefaultBlobDirMediaType specifies the default blob directory media type DefaultBlobDirMediaType = ocispec.MediaTypeImageLayerGzip )
View Source
const ( // AnnotationDigest is the annotation key for the digest of the uncompressed content AnnotationDigest = "io.deis.oras.content.digest" // AnnotationUnpack is the annotation key for indication of unpacking AnnotationUnpack = "io.deis.oras.content.unpack" )
View Source
const (
// TempFilePattern specifies the pattern to create temporary files
TempFilePattern = "oras"
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("not_found") ErrNoName = errors.New("no_name") ErrUnsupportedSize = errors.New("unsupported_size") )
Common errors
View Source
var ( ErrPathTraversalDisallowed = errors.New("path_traversal_disallowed") ErrOverwriteDisallowed = errors.New("overwrite_disallowed") )
FileStore errors
Functions ¶
func ResolveName ¶
func ResolveName(desc ocispec.Descriptor) (string, bool)
ResolveName resolves name from descriptor
Types ¶
type FileStore ¶
type FileStore struct { DisableOverwrite bool AllowPathTraversalOnWrite bool // contains filtered or unexported fields }
FileStore provides content from the file system
func NewFileStore ¶
NewFileStore creats a new file store
func (*FileStore) Add ¶
func (s *FileStore) Add(name, mediaType, path string) (ocispec.Descriptor, error)
Add adds a file reference
func (*FileStore) ReaderAt ¶
func (s *FileStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error)
ReaderAt provides contents
func (*FileStore) ResolvePath ¶
ResolvePath returns the path by name
type Memorystore ¶
type Memorystore struct {
// contains filtered or unexported fields
}
Memorystore provides content from the memory
func (*Memorystore) Add ¶
func (s *Memorystore) Add(name, mediaType string, content []byte) ocispec.Descriptor
Add adds content
func (*Memorystore) Get ¶
func (s *Memorystore) Get(desc ocispec.Descriptor) (ocispec.Descriptor, []byte, bool)
Get finds the content from the store
func (*Memorystore) GetByName ¶
func (s *Memorystore) GetByName(name string) (ocispec.Descriptor, []byte, bool)
GetByName finds the content from the store by name (i.e. AnnotationTitle)
func (*Memorystore) ReaderAt ¶
func (s *Memorystore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error)
ReaderAt provides contents
func (*Memorystore) Set ¶
func (s *Memorystore) Set(desc ocispec.Descriptor, content []byte)
Set adds the content to the store
Click to show internal directories.
Click to hide internal directories.