local

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemRepo

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

ItemRepo stores item models in local memory.

func NewItemRepo

func NewItemRepo() *ItemRepo

NewItemRepo creates a new ItemRepo using local memory as the storage medium.

func (*ItemRepo) Create

func (r *ItemRepo) Create(ctx context.Context, it domain.Item) (domain.Item, error)

Create creates a new item with the properties of the given item model.

func (*ItemRepo) Delete

func (r *ItemRepo) Delete(ctx context.Context, id string) error

Delete removes the item identified by the specified id.

func (*ItemRepo) Get

func (r *ItemRepo) Get(ctx context.Context, id string) (domain.Item, error)

Get retrieves the item identified by the specified id.

func (*ItemRepo) Update

func (r *ItemRepo) Update(ctx context.Context, id string, updates domain.Item) (domain.Item, error)

Create updates the fields of the item identified by id to match the fields of the given item model.

Jump to

Keyboard shortcuts

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