Documentation ¶
Index ¶
- type MemoryStorage
- func (st *MemoryStorage) Clean(ctx context.Context) error
- func (st *MemoryStorage) ReadBytes(ctx context.Context, key string) ([]byte, error)
- func (st *MemoryStorage) ReadStream(ctx context.Context, key string) (io.ReadCloser, error)
- func (st *MemoryStorage) Remove(ctx context.Context, key string) error
- func (st *MemoryStorage) Stat(ctx context.Context, key string) (*storage.Entry, error)
- func (st *MemoryStorage) WalkKeys(ctx context.Context, opts storage.WalkKeysOpts) error
- func (st *MemoryStorage) WriteBytes(ctx context.Context, key string, b []byte) (int, error)
- func (st *MemoryStorage) WriteStream(ctx context.Context, key string, r io.Reader) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage is a storage implementation that simply stores key-value pairs in a Go map in-memory. The map is protected by a mutex.
func Open ¶
func Open(size int, overwrites bool) *MemoryStorage
Open opens a new MemoryStorage instance with internal map starting size.
func (*MemoryStorage) Clean ¶
func (st *MemoryStorage) Clean(ctx context.Context) error
Clean: implements Storage.Clean().
func (*MemoryStorage) ReadStream ¶
func (st *MemoryStorage) ReadStream(ctx context.Context, key string) (io.ReadCloser, error)
ReadStream: implements Storage.ReadStream().
func (*MemoryStorage) Remove ¶
func (st *MemoryStorage) Remove(ctx context.Context, key string) error
Remove: implements Storage.Remove().
func (*MemoryStorage) Stat ¶
func (st *MemoryStorage) Stat(ctx context.Context, key string) (*storage.Entry, error)
Stat: implements Storage.Stat().
func (*MemoryStorage) WalkKeys ¶
func (st *MemoryStorage) WalkKeys(ctx context.Context, opts storage.WalkKeysOpts) error
WalkKeys: implements Storage.WalkKeys().
func (*MemoryStorage) WriteBytes ¶
WriteBytes: implements Storage.WriteBytes().
func (*MemoryStorage) WriteStream ¶
WriteStream: implements Storage.WriteStream().
Click to show internal directories.
Click to hide internal directories.