oras

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBlobMediaType = ocispec.MediaTypeImageLayer

DefaultBlobMediaType specifies the default blob media type

Variables

View Source
var (
	ErrNotFound          = errors.New("not_found")
	ErrResolverUndefined = errors.New("resolver_undefined")
	ErrEmptyBlobs        = errors.New("empty_blobs")
)

Common errors

Functions

func Pull

func Pull(ctx context.Context, resolver remotes.Resolver, ref string, allowedMediaTypes ...string) (map[string]Blob, error)

Pull pull files from the remote

func Push

func Push(ctx context.Context, resolver remotes.Resolver, ref string, blobs map[string]Blob) error

Push pushes files to the remote

Types

type Blob added in v0.2.0

type Blob struct {
	MediaType string
	Content   []byte
}

Blob refers a blob with a media type

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore stores contents in the memory

func NewMemoryStore

func NewMemoryStore() *MemoryStore

NewMemoryStore creates a new memory store

func (*MemoryStore) FetchHandler

func (s *MemoryStore) FetchHandler(fetcher remotes.Fetcher) images.HandlerFunc

FetchHandler returnes a handler that will fetch all content into the memory store discovered in a call to Dispath. Use with ChildrenHandler to do a full recurisive fetch.

func (*MemoryStore) Get

func (s *MemoryStore) Get(desc ocispec.Descriptor) ([]byte, bool)

Get finds the content from the store

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL