Documentation ¶
Index ¶
- Constants
- Variables
- type ArtifactID
- type Callback
- type LocalStorage
- func (s LocalStorage) CreateLocationAndDo(id ArtifactID, data []byte, cb Callback) error
- func (s LocalStorage) GetItem(id ArtifactID) (ReadCloseSizer, error)
- func (s LocalStorage) HasItem(id ArtifactID) (bool, error)
- func (s LocalStorage) StartCleaner(ctx context.Context, interval time.Duration, wg *sync.WaitGroup)
- type ReadCloseSizer
- type StoreProvider
Constants ¶
View Source
const ( // ExtWasm is wasm file extension ExtWasm = "wasm" // ExtGo is go file extension ExtGo = "go" )
Variables ¶
View Source
var ErrNotExists = errors.New("item not exists")
ErrNotExists is item not found error
Functions ¶
This section is empty.
Types ¶
type ArtifactID ¶
type ArtifactID string
ArtifactID represents artifact ID
func GetArtifactID ¶
func GetArtifactID(data []byte) (ArtifactID, error)
GetArtifactID generates new artifact ID from contents
func (ArtifactID) Ext ¶
func (a ArtifactID) Ext(ext string) string
Ext returns string with artifact ID and extension
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage is local build artigact storage
func NewLocalStorage ¶
func NewLocalStorage(log *zap.SugaredLogger, baseDir string) (ls *LocalStorage, err error)
NewLocalStorage constructs new local storage
func (LocalStorage) CreateLocationAndDo ¶
func (s LocalStorage) CreateLocationAndDo(id ArtifactID, data []byte, cb Callback) error
CreateLocationAndDo implements storage interface
func (LocalStorage) GetItem ¶
func (s LocalStorage) GetItem(id ArtifactID) (ReadCloseSizer, error)
GetItem implements storage interface
func (LocalStorage) HasItem ¶
func (s LocalStorage) HasItem(id ArtifactID) (bool, error)
HasItem implements storage interface
func (LocalStorage) StartCleaner ¶
StartCleaner implements storage interface
type ReadCloseSizer ¶
type ReadCloseSizer interface { io.ReadCloser Size() int64 }
type StoreProvider ¶
type StoreProvider interface { // HasItem checks if item exists HasItem(id ArtifactID) (bool, error) // GetItem returns item by id GetItem(id ArtifactID) (ReadCloseSizer, error) // CreateLocationAndDo creates entry in storage and runs specified callback with new location CreateLocationAndDo(id ArtifactID, data []byte, cb Callback) error }
StoreProvider is abstract artifact storage
Click to show internal directories.
Click to hide internal directories.