stores

package
v0.0.0-...-3b802f3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserMemoryStore

type UserMemoryStore struct {
	Clock clockwork.Clock
	// contains filtered or unexported fields
}

In Memory implementation of the UserStore interface

func NewUserMemoryStore

func NewUserMemoryStore(clock clockwork.Clock) *UserMemoryStore

Constructs a new UserMemoryStore instance

func (*UserMemoryStore) All

func (s *UserMemoryStore) All() []models.User

func (*UserMemoryStore) Create

func (s *UserMemoryStore) Create(u models.User) (models.User, error)

func (*UserMemoryStore) Delete

func (s *UserMemoryStore) Delete(id uuid.UUID) (bool, error)

func (*UserMemoryStore) Exists

func (s *UserMemoryStore) Exists(id uuid.UUID) (bool, error)

func (*UserMemoryStore) Find

func (s *UserMemoryStore) Find(id uuid.UUID) (models.User, error)

func (*UserMemoryStore) Reset

func (s *UserMemoryStore) Reset()

Helper for resetting state in between tests

func (*UserMemoryStore) Update

func (s *UserMemoryStore) Update(u models.User) (models.User, error)

type UserStore

type UserStore interface {
	All() []models.User
	Exists(id uuid.UUID) (bool, error)
	Find(id uuid.UUID) (models.User, error)
	Create(user models.User) (models.User, error)
	Update(user models.User) (models.User, error)
	Delete(id uuid.UUID) (bool, error)
	Reset()
}

UserStore interface for persisting users

Jump to

Keyboard shortcuts

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