inmemory

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeckNotFound = errors.New("deck not found")

ErrDeckNotFound is the error returned when a deck is not found.

Functions

This section is empty.

Types

type Repository

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

Repository is an in-memory implementation of the deckr.Repository interface.

func NewRepository

func NewRepository(log *logger.Logger) *Repository

NewRepository creates a new in-memory repository.

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, id string) (*repo.Deck, error)

Get returns the deck with the given id.

func (*Repository) Save

func (r *Repository) Save(ctx context.Context, d *repo.Deck) error

Save saves the given deck.

Jump to

Keyboard shortcuts

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