storage

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtWasm = "wasm"
	ExtGo   = "go"
)

Variables

View Source
var ErrNotExists = errors.New("item not exists")

Functions

This section is empty.

Types

type ArtifactID

type ArtifactID string

ArtifactID represents artifact ID

func GetArtifactID

func GetArtifactID(data []byte) (ArtifactID, error)

func (ArtifactID) Ext

func (a ArtifactID) Ext(ext string) string

Ext returns string with artifact ID and extension

func (ArtifactID) String

func (a ArtifactID) String() string

type Callback

type Callback = func(wasmLocation, sourceLocation string) error

type LocalStorage

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

func NewLocalStorage

func NewLocalStorage(log *zap.SugaredLogger, baseDir string) (ls *LocalStorage, err error)

func (LocalStorage) CreateLocationAndDo

func (s LocalStorage) CreateLocationAndDo(id ArtifactID, data []byte, cb Callback) error

func (LocalStorage) GetItem

func (s LocalStorage) GetItem(id ArtifactID) (io.ReadCloser, error)

func (LocalStorage) HasItem

func (s LocalStorage) HasItem(id ArtifactID) (bool, error)

func (LocalStorage) StartCleaner

func (s LocalStorage) StartCleaner(ctx context.Context, interval time.Duration, wg *sync.WaitGroup)

type StoreProvider

type StoreProvider interface {
	HasItem(id ArtifactID) (bool, error)
	GetItem(id ArtifactID) (io.ReadCloser, error)
	CreateLocationAndDo(id ArtifactID, data []byte, cb Callback) error
}

Jump to

Keyboard shortcuts

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