repository

package
v0.0.0-...-1f60ca4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataSourceErr = errors.New("data source is not working")
View Source
var UnexpectedTypeErr = errors.New("unable to get object as expected type")

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	// Save a translation
	Save(word models.TranslationPair) error

	// List get back all the saved translations
	List() ([]models.TranslationPair, error)
}

DataSource specify the operations for storing data

func NewInMemoryDataSource

func NewInMemoryDataSource() DataSource

type InMemoryDataSource

type InMemoryDataSource struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*InMemoryDataSource) List

func (*InMemoryDataSource) Save

Jump to

Keyboard shortcuts

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