store

package
v0.0.0-...-c234f5e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 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 MemStore

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

func (*MemStore) Create

func (ms *MemStore) Create(book *mystore.Book) error

Create creates a new Book in the store.

func (*MemStore) Delete

func (ms *MemStore) Delete(id string) error

Delete deletes the book with the given id. If no such id exist. an error is returned.

func (*MemStore) Get

func (ms *MemStore) Get(id string) (mystore.Book, error)

Get retrieves a book from the store, by id. If no such id exists. an error is returned.

func (*MemStore) GetAll

func (ms *MemStore) GetAll() ([]mystore.Book, error)

GetAll returns all the books in the store, in arbitrary order.

func (*MemStore) Update

func (ms *MemStore) Update(book *mystore.Book) error

Update updates the existed Book in the store.

Jump to

Keyboard shortcuts

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