datastore

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 6 Imported by: 12

README

Go Report Card

A mockable datastore written in golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	Path string
	// contains filtered or unexported fields
}

DataStore Datastore

func (*DataStore) Delete added in v1.0.1

func (d *DataStore) Delete(name string) bool

Delete Delete

func (*DataStore) GetNew

func (d *DataStore) GetNew() JSONDatastore

GetNew GetNew

func (*DataStore) Read

func (d *DataStore) Read(name string) *[]byte

func (*DataStore) ReadAll added in v1.0.2

func (d *DataStore) ReadAll() *[][]byte

ReadAll ReadAll

func (*DataStore) Reload added in v1.0.5

func (d *DataStore) Reload() bool

Reload Reload

func (*DataStore) Save

func (d *DataStore) Save(name string, data interface{}) bool

Save Save

type JSONDatastore

type JSONDatastore interface {
	Save(name string, data interface{}) bool
	Read(name string) *[]byte
	ReadAll() *[][]byte
	Delete(name string) bool
	Reload() bool
}

JSONDatastore JSONDatastore

type MockDataStore

type MockDataStore struct {
	Path              string
	MockSuccess       bool
	MockDeleteSuccess bool
	MockReloadSuccess bool
	MockData          []byte
	MockDataList      [][]byte
}

MockDataStore Datastore

func (*MockDataStore) Delete added in v1.0.1

func (d *MockDataStore) Delete(name string) bool

Delete Delete

func (*MockDataStore) GetNew

func (d *MockDataStore) GetNew() JSONDatastore

GetNew GetNew

func (*MockDataStore) Read

func (d *MockDataStore) Read(name string) *[]byte

Read Read

func (*MockDataStore) ReadAll added in v1.0.2

func (d *MockDataStore) ReadAll() *[][]byte

ReadAll ReadAll

func (*MockDataStore) Reload added in v1.0.5

func (d *MockDataStore) Reload() bool

Reload Reload

func (*MockDataStore) Save

func (d *MockDataStore) Save(name string, data interface{}) bool

Save Save

Jump to

Keyboard shortcuts

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