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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemStore

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

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