puppy

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapStore

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

func NewMapStore

func NewMapStore() *MapStore

NewMapStore initialise a new MapStore

func (*MapStore) CreatePuppy

func (m *MapStore) CreatePuppy(p *puppy.Puppy) (uint32, error)

CreatePuppy create a new puppy and store in mapStore.

func (MapStore) DeletePuppy

func (m MapStore) DeletePuppy(id uint32) (bool, error)

DeletePuppy delete the puppy given the id. It returns true/success or false/unsuccessful.

func (MapStore) ReadPuppy

func (m MapStore) ReadPuppy(id uint32) (*puppy.Puppy, error)

ReadPuppy read a puppy given its id. It returns the pointer to that puppy.

func (MapStore) UpdatePuppy

func (m MapStore) UpdatePuppy(id uint32, p *puppy.Puppy) (bool, error)

UpdatePuppy updates the store with key of id with the new puppy. It returns a boolean whether the operation is successful or not.

type Storer

type Storer interface {
	CreatePuppy(*puppy.Puppy) (uint32, error)
	ReadPuppy(ID uint32) (*puppy.Puppy, error)
	UpdatePuppy(ID uint32, puppy *puppy.Puppy) (bool, error)
	DeletePuppy(ID uint32) (bool, error)
}

type SyncStore

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

func NewSyncStore

func NewSyncStore() *SyncStore

NewMapStore initialise a new SyncStore

func (*SyncStore) CreatePuppy

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

CreatePuppy create a new puppy and store in mapStore.

func (*SyncStore) DeletePuppy

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

DeletePuppy delete the puppy given the id. It returns true/success or false/unsuccessful

func (*SyncStore) ReadPuppy

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

ReadPuppy read a puppy given its id. It returns the pointer to that puppy.

func (*SyncStore) UpdatePuppy

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

UpdatePuppy updates the store with key of id with the new puppy. It returns a boolean whether the operation is successful or not.

Jump to

Keyboard shortcuts

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