store

package
v0.0.0-...-cf576ff Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBStore

type LevelDBStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LevelDBStore provides sync for leveldb

func NewLevelDBStorer

func NewLevelDBStorer() *LevelDBStore

NewLevelDBStorer creates new storer for leveldb

func (*LevelDBStore) CreatePuppy

func (l *LevelDBStore) CreatePuppy(p *puppy.Puppy) (int, error)

CreatePuppy creates puppy

func (*LevelDBStore) DeletePuppy

func (l *LevelDBStore) DeletePuppy(id int) (bool, error)

DeletePuppy deletes puppy

func (*LevelDBStore) ReadPuppy

func (l *LevelDBStore) ReadPuppy(id int) (*puppy.Puppy, error)

ReadPuppy reads puppy from backend

func (*LevelDBStore) UpdatePuppy

func (l *LevelDBStore) UpdatePuppy(id int, p *puppy.Puppy) error

UpdatePuppy updates puppy

type MemStore

type MemStore map[int]puppy.Puppy

MemStore map based type for storing puppies data

func NewMemStore

func NewMemStore() MemStore

NewMemStore creates new storer for map

func (MemStore) CreatePuppy

func (m MemStore) CreatePuppy(p *puppy.Puppy) (int, error)

CreatePuppy creates puppy

func (MemStore) DeletePuppy

func (m MemStore) DeletePuppy(id int) (bool, error)

DeletePuppy deletes puppy

func (MemStore) ReadPuppy

func (m MemStore) ReadPuppy(id int) (*puppy.Puppy, error)

ReadPuppy reads puppy from backend

func (MemStore) UpdatePuppy

func (m MemStore) UpdatePuppy(id int, p *puppy.Puppy) error

UpdatePuppy updates puppy

type SyncStore

type SyncStore struct {
	sync.Map
	sync.Mutex
	// contains filtered or unexported fields
}

SyncStore sync.Map based type for storing puppies data

func NewSyncStore

func NewSyncStore() *SyncStore

NewSyncStore creates new storer for SyncMap

func (*SyncStore) CreatePuppy

func (s *SyncStore) CreatePuppy(p *puppy.Puppy) (int, error)

CreatePuppy creates puppy

func (*SyncStore) DeletePuppy

func (s *SyncStore) DeletePuppy(id int) (bool, error)

DeletePuppy deletes puppy

func (*SyncStore) ReadPuppy

func (s *SyncStore) ReadPuppy(id int) (*puppy.Puppy, error)

ReadPuppy reads puppy from backend

func (*SyncStore) UpdatePuppy

func (s *SyncStore) UpdatePuppy(id int, p *puppy.Puppy) error

UpdatePuppy updates puppy

Jump to

Keyboard shortcuts

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