memory_cache

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache(maxSizeBytes int64) (*MemoryCache, error)

func (*MemoryCache) Contains

func (m *MemoryCache) Contains(ctx context.Context, d *repb.Digest) (bool, error)

func (*MemoryCache) ContainsMulti

func (m *MemoryCache) ContainsMulti(ctx context.Context, digests []*repb.Digest) (map[*repb.Digest]bool, error)

func (*MemoryCache) Delete

func (m *MemoryCache) Delete(ctx context.Context, d *repb.Digest) error

func (*MemoryCache) Get

func (m *MemoryCache) Get(ctx context.Context, d *repb.Digest) ([]byte, error)

func (*MemoryCache) GetMulti

func (m *MemoryCache) GetMulti(ctx context.Context, digests []*repb.Digest) (map[*repb.Digest][]byte, error)

func (*MemoryCache) Reader

func (m *MemoryCache) Reader(ctx context.Context, d *repb.Digest, offset int64) (io.Reader, error)

Low level interface used for seeking and stream-writing.

func (*MemoryCache) Set

func (m *MemoryCache) Set(ctx context.Context, d *repb.Digest, data []byte) error

func (*MemoryCache) SetMulti

func (m *MemoryCache) SetMulti(ctx context.Context, kvs map[*repb.Digest][]byte) error

func (*MemoryCache) Start

func (m *MemoryCache) Start() error

func (*MemoryCache) Stop

func (m *MemoryCache) Stop() error

func (*MemoryCache) WithPrefix

func (m *MemoryCache) WithPrefix(prefix string) interfaces.Cache

func (*MemoryCache) Writer

func (m *MemoryCache) Writer(ctx context.Context, d *repb.Digest) (io.WriteCloser, error)

Jump to

Keyboard shortcuts

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