store

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	sync.RWMutex

	Data []byte
}

func NewBlob

func NewBlob(size int) *Blob

func (*Blob) CopyFrom added in v0.2.0

func (b *Blob) CopyFrom(buf []byte) error

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store is a simple Key-Value store

func NewStore added in v0.2.0

func NewStore() *Store

func (*Store) Create

func (s *Store) Create(name string, size int) (*Blob, error)

func (*Store) Get

func (s *Store) Get(name string) (*Blob, error)

func (*Store) GetOrCreate added in v0.2.0

func (s *Store) GetOrCreate(name string, size int) (*Blob, error)

type VersionedStore

type VersionedStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewVersionedStore

func NewVersionedStore(windowSize int) *VersionedStore

func (*VersionedStore) Create

func (s *VersionedStore) Create(version, name string, size int) (*Blob, error)

func (*VersionedStore) Get

func (s *VersionedStore) Get(version, name string) (*Blob, error)

func (*VersionedStore) GetNextVersion

func (s *VersionedStore) GetNextVersion(prev string) string

func (*VersionedStore) GetOrCreate added in v0.2.0

func (s *VersionedStore) GetOrCreate(version, name string, size int) (*Blob, error)

Jump to

Keyboard shortcuts

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