Documentation ¶
Overview ¶
Package memory is an in memory storage backend for Shade.
It stores files and chunks transiently in RAM.
Index ¶
- func NewClient(c drive.Config) (drive.Client, error)
- type Drive
- func (s *Drive) GetChunk(sha256sum []byte, _ *shade.File) ([]byte, error)
- func (s *Drive) GetConfig() drive.Config
- func (s *Drive) GetFile(sha256sum []byte) ([]byte, error)
- func (s *Drive) ListChunks() [][]byte
- func (s *Drive) ListFiles() ([][]byte, error)
- func (s *Drive) Local() bool
- func (s *Drive) Persistent() bool
- func (s *Drive) PutChunk(sha256sum []byte, chunk []byte, _ *shade.File) error
- func (s *Drive) PutFile(sha256sum, f []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Drive ¶
type Drive struct {
// contains filtered or unexported fields
}
Drive implements the drive.Client interface by storing Files and Chunks transiently in RAM. The provided config can be returned, but is otherwise ignored.
func (*Drive) ListChunks ¶
ListChunks returns all the chunks known to the memory client. It is helpful for tests.
func (*Drive) ListFiles ¶
ListFiles retrieves all of the File objects known to the client. The return is a list of sha256sums of the file object. The keys may be passed to GetFile() to retrieve the corresponding shade.File.
func (*Drive) Persistent ¶
Persistent returns whether the storage is persistent across task restarts.
Click to show internal directories.
Click to hide internal directories.