Documentation ¶
Index ¶
- type InMememoryRepository
- func (r *InMememoryRepository) CreateWord(ctx context.Context, word string) (*rememberer.Word, error)
- func (r *InMememoryRepository) DeleteWordById(ctx context.Context, id string) error
- func (r *InMememoryRepository) GetWordById(ctx context.Context, id string) (*rememberer.Word, error)
- func (r *InMememoryRepository) GetWordByName(ctx context.Context, name string) (*rememberer.Word, error)
- func (r *InMememoryRepository) GetWords(ctx context.Context) ([]rememberer.Word, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMememoryRepository ¶
type InMememoryRepository struct { // Store holds "persistent" words Store []rememberer.Word }
InMememoryRepository holds the methods for managing words
func NewInMememoryRepository ¶
func NewInMememoryRepository() *InMememoryRepository
NewInMememoryRepository returns a new in-memory repository
func (*InMememoryRepository) CreateWord ¶
func (r *InMememoryRepository) CreateWord(ctx context.Context, word string) (*rememberer.Word, error)
CreateWord adds word to the repository
func (*InMememoryRepository) DeleteWordById ¶
func (r *InMememoryRepository) DeleteWordById(ctx context.Context, id string) error
DeleteWordById removes a word in the repository that matches the has the passed id
func (*InMememoryRepository) GetWordById ¶
func (r *InMememoryRepository) GetWordById(ctx context.Context, id string) (*rememberer.Word, error)
GetWordById returns a word in the repository that matches the passed id
func (*InMememoryRepository) GetWordByName ¶
func (r *InMememoryRepository) GetWordByName(ctx context.Context, name string) (*rememberer.Word, error)
GetWordById returns a word in the repository that matches the has the passed name
func (*InMememoryRepository) GetWords ¶
func (r *InMememoryRepository) GetWords(ctx context.Context) ([]rememberer.Word, error)
GetWords returns all the words in the repository
Click to show internal directories.
Click to hide internal directories.