store

package
v0.0.0-...-75d348f Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid")
View Source
var ErrNotSupported = errors.New("not suppored")

Functions

func NewNotFoundError

func NewNotFoundError(name string) error

func SendImage

func SendImage(shell *net.ScpShell, location string, image *Image) (string, error)

Types

type Blobs

type Blobs map[string][]byte

type FileStore

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

FileStore layout <location>/<name>/

blobs/
     <digest>
     ...
manifests/
     <reference>
     ...

func (*FileStore) GetBlob

func (r *FileStore) GetBlob(cid, digest string) ([]byte, error)

func (*FileStore) GetManifest

func (r *FileStore) GetManifest(cid, reference string) ([]byte, error)

func (*FileStore) HasBlob

func (r *FileStore) HasBlob(cid, digest string) bool

func (*FileStore) Resolve

func (r *FileStore) Resolve(name string, ref string) ([]string, error)

func (*FileStore) Save

func (r *FileStore) Save(image *Image) (string, error)

func (*FileStore) String

func (r *FileStore) String() string

type Image

type Image struct {
	Name      string
	Manifests Manifests
	Blobs     Blobs
}

func LoadImage

func LoadImage(location string) (*Image, error)

func NewImage

func NewImage(name string, manifests map[string][]byte, blobs map[string][]byte) *Image

type IpfsStore

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

func (*IpfsStore) GetBlob

func (r *IpfsStore) GetBlob(cid, digest string) ([]byte, error)

func (*IpfsStore) GetManifest

func (r *IpfsStore) GetManifest(cid, reference string) ([]byte, error)

func (*IpfsStore) HasBlob

func (r *IpfsStore) HasBlob(cid, digest string) bool

func (*IpfsStore) Resolve

func (r *IpfsStore) Resolve(name string, ref string) ([]string, error)

func (*IpfsStore) Save

func (r *IpfsStore) Save(image *Image) (string, error)

type Manifests

type Manifests map[string][]byte

type MemoryStore

type MemoryStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*MemoryStore) GetBlob

func (r *MemoryStore) GetBlob(cid, digest string) ([]byte, error)

func (*MemoryStore) GetManifest

func (r *MemoryStore) GetManifest(cid, reference string) ([]byte, error)

func (*MemoryStore) HasBlob

func (r *MemoryStore) HasBlob(cid, digest string) bool

func (*MemoryStore) Resolve

func (r *MemoryStore) Resolve(name string, ref string) ([]string, error)

func (*MemoryStore) Save

func (r *MemoryStore) Save(image *Image) (string, error)

type NotFoundError

type NotFoundError struct {
	Name string
	Err  error
}

NotFoundError not found

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

type ScpStore

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

ScpStore uses scp.

func (*ScpStore) GetBlob

func (r *ScpStore) GetBlob(cid, digest string) ([]byte, error)

func (*ScpStore) GetManifest

func (r *ScpStore) GetManifest(cid, reference string) ([]byte, error)

func (*ScpStore) HasBlob

func (r *ScpStore) HasBlob(cid, digest string) bool

func (*ScpStore) Resolve

func (r *ScpStore) Resolve(name string, ref string) ([]string, error)

func (*ScpStore) Save

func (r *ScpStore) Save(image *Image) (string, error)

func (*ScpStore) String

func (r *ScpStore) String() string

type Store

type Store interface {
	Save(image *Image) (string, error)
	Resolve(name, reference string) ([]string, error)
	HasBlob(cid, digest string) bool
	GetBlob(cid, digest string) ([]byte, error)
	GetManifest(cid, reference string) ([]byte, error)
}

func Create

func Create(s string) Store

Create store

func NewFileStore

func NewFileStore(uri string) Store

NewFileStore creates a local file system store file:/path

func NewIpfsStore

func NewIpfsStore(uri string) Store

func NewMemoryStore

func NewMemoryStore(uri string) Store

func NewScpStore

func NewScpStore(uri string) Store

NewScpStore creates a remote store via ssh

Jump to

Keyboard shortcuts

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