mockableprovider

package
v0.0.0-...-2d52d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Mutex        *sync.Mutex
	CreateError  error
	UpdateError  error
	DeleteError  error
	GetByIDError error
	GetAllError  error
	// contains filtered or unexported fields
}

Provider is a mockable provider

func NewProvider

func NewProvider() *Provider

NewProvider builds and returns a valid Provider

func (*Provider) Create

func (p *Provider) Create(id string, v interface{}) error

Create and item in the store

func (*Provider) Delete

func (p *Provider) Delete(id string) error

Delete an item from the store

func (*Provider) GetAll

func (p *Provider) GetAll() ([]interface{}, error)

GetAll items from the store

func (*Provider) GetByID

func (p *Provider) GetByID(id string) (interface{}, error)

GetByID gets an item by id

func (*Provider) Update

func (p *Provider) Update(id string, v interface{}) error

Update an item in the store by id

Jump to

Keyboard shortcuts

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