Versions in this module Expand all Collapse all v1 v1.2.5 Aug 7, 2023 v1.2.4 Aug 7, 2023 Changes in this version + const AnnotationDigest + const AnnotationUnpack + const BlankHash + const DefaultBlobDirMediaType + const DefaultBlobMediaType + const DefaultBlocksize + const OCIImageIndexFile + const TempFilePattern + var ErrInvalidReference = errors.New("invalid_reference") + var ErrNoName = errors.New("no_name") + var ErrNotFound = errors.New("not_found") + var ErrOverwriteDisallowed = errors.New("overwrite_disallowed") + var ErrPathTraversalDisallowed = errors.New("path_traversal_disallowed") + var ErrUnsupportedSize = errors.New("unsupported_size") + var ErrUnsupportedVersion = errors.New("unsupported_version") + func GenerateConfig(annotations map[string]string) ([]byte, ocispec.Descriptor, error) + func GenerateManifest(config *ocispec.Descriptor, annotations map[string]string, ...) ([]byte, ocispec.Descriptor, error) + func GenerateManifestAndConfig(manifestAnnotations map[string]string, configAnnotations map[string]string, ...) (manifest []byte, manifestDesc ocispec.Descriptor, config []byte, ...) + func NewGunzipWriter(writer content.Writer, opts ...WriterOpt) content.Writer + func NewIoContentWriter(writer io.Writer, opts ...WriterOpt) content.Writer + func NewPassthroughMultiWriter(writers func(name string) (content.Writer, error), ...) content.Writer + func NewPassthroughWriter(writer content.Writer, f func(r io.Reader, w io.Writer, done chan<- error), ...) content.Writer + func NewUntarWriter(writer content.Writer, opts ...WriterOpt) content.Writer + func NewUntarWriterByName(writers func(string) (content.Writer, error), opts ...WriterOpt) content.Writer + func NopCloserAt(r io.ReaderAt) nopCloserAt + func ResolveName(desc ocispec.Descriptor) (string, bool) + type Decompress struct + func NewDecompress(pusher remotes.Pusher, opts ...WriterOpt) Decompress + func (d Decompress) Push(ctx context.Context, desc ocispec.Descriptor) (ctrcontent.Writer, error) + type File struct + AllowPathTraversalOnWrite bool + DisableOverwrite bool + Reproducible bool + func NewFile(rootPath string, opts ...WriterOpt) *File + func (s *File) Add(name, mediaType, path string) (ocispec.Descriptor, error) + func (s *File) Close() error + func (s *File) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) + func (s *File) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) + func (s *File) Load(desc ocispec.Descriptor, data []byte) error + func (s *File) MapPath(name, path string) string + func (s *File) Pusher(ctx context.Context, ref string) (remotes.Pusher, error) + func (s *File) Ref(ref string) (ocispec.Descriptor, []byte, error) + func (s *File) Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error) + func (s *File) ResolvePath(name string) string + func (s *File) Resolver() remotes.Resolver + func (s *File) StoreManifest(ref string, desc ocispec.Descriptor, manifest []byte) error + type IoContentWriter struct + func (w *IoContentWriter) Close() error + func (w *IoContentWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error + func (w *IoContentWriter) Digest() digest.Digest + func (w *IoContentWriter) Status() (content.Status, error) + func (w *IoContentWriter) Truncate(size int64) error + func (w *IoContentWriter) Write(p []byte) (n int, err error) + type Memory struct + func NewMemory() *Memory + func (s *Memory) Add(name, mediaType string, content []byte) (ocispec.Descriptor, error) + func (s *Memory) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) + func (s *Memory) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) + func (s *Memory) Get(desc ocispec.Descriptor) (ocispec.Descriptor, []byte, bool) + func (s *Memory) GetByName(name string) (ocispec.Descriptor, []byte, bool) + func (s *Memory) Pusher(ctx context.Context, ref string) (remotes.Pusher, error) + func (s *Memory) Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error) + func (s *Memory) Resolver() remotes.Resolver + func (s *Memory) Set(desc ocispec.Descriptor, content []byte) + func (s *Memory) StoreManifest(ref string, desc ocispec.Descriptor, manifest []byte) error + type MultiReader struct + func (m *MultiReader) AddStore(store ...remotes.Fetcher) + func (m MultiReader) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) + type MultiWriterIngester interface + Writers func(ctx context.Context, opts ...ctrcontent.WriterOpt) (func(string) (ctrcontent.Writer, error), error) + type MultiWriterPusher interface + Pushers func(ctx context.Context, desc ocispec.Descriptor) (func(string) (ctrcontent.Writer, error), error) + type OCI struct + func NewOCI(rootPath string) (*OCI, error) + func (s *OCI) Abort(ctx context.Context, ref string) error + func (s *OCI) AddReference(name string, desc ocispec.Descriptor) + func (s *OCI) Delete(ctx context.Context, dgst digest.Digest) error + func (s *OCI) DeleteReference(name string) + func (s *OCI) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) + func (s *OCI) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) + func (s *OCI) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) + func (s *OCI) ListReferences() map[string]ocispec.Descriptor + func (s *OCI) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error) + func (s *OCI) LoadIndex() error + func (s *OCI) Pusher(ctx context.Context, ref string) (remotes.Pusher, error) + func (s *OCI) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) + func (s *OCI) Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error) + func (s *OCI) Resolver() remotes.Resolver + func (s *OCI) SaveIndex() error + func (s *OCI) Status(ctx context.Context, ref string) (content.Status, error) + func (s *OCI) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) + func (s *OCI) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error + type PassthroughMultiWriter struct + func (pmw *PassthroughMultiWriter) Close() error + func (pmw *PassthroughMultiWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error + func (pmw *PassthroughMultiWriter) Digest() digest.Digest + func (pmw *PassthroughMultiWriter) Status() (content.Status, error) + func (pmw *PassthroughMultiWriter) Truncate(size int64) error + func (pmw *PassthroughMultiWriter) Write(p []byte) (n int, err error) + type PassthroughWriter struct + func (pw *PassthroughWriter) Close() error + func (pw *PassthroughWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error + func (pw *PassthroughWriter) Digest() digest.Digest + func (pw *PassthroughWriter) Status() (content.Status, error) + func (pw *PassthroughWriter) Truncate(size int64) error + func (pw *PassthroughWriter) Write(p []byte) (n int, err error) + type ReaderAtWrapper struct + func NewReaderAtWrapper(readerAt io.ReaderAt) *ReaderAtWrapper + func (r *ReaderAtWrapper) Read(p []byte) (n int, err error) + type Registry struct + func NewRegistry(opts RegistryOptions) (*Registry, error) + type RegistryOptions struct + Configs []string + Insecure bool + Password string + PlainHTTP bool + Username string + type Store interface + type WriterOpt func(*WriterOpts) error + func WithBlocksize(blocksize int) WriterOpt + func WithErrorOnNoName() WriterOpt + func WithIgnoreNoName() WriterOpt + func WithInputHash(hash digest.Digest) WriterOpt + func WithMultiWriterIngester() WriterOpt + func WithOutputHash(hash digest.Digest) WriterOpt + type WriterOpts struct + Blocksize int + IgnoreNoName bool + InputHash *digest.Digest + MultiWriterIngester bool + OutputHash *digest.Digest + func DefaultWriterOpts() WriterOpts