storage

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateMockedError

func ActivateMockedError()

ActivateMockedError forces the return of ErrMockedError from current storage manager. This method should only be used for testing purposes.

func DeactivateMockedError

func DeactivateMockedError()

DeactivateMockedError disables mocked storage error from a previous activation. This method should only be used for testing purposes.

func Initialize

func Initialize(cfg *Config)

Initialize initializes storage sub system.

func Shutdown

func Shutdown()

Shutdown shuts down storage sub system. This method should be used only for testing purposes.

Types

type Config added in v0.2.0

type Config struct {
	Type     StorageType
	MySQL    *sql.Config
	BadgerDB *badgerdb.Config
}

Config represents an storage manager configuration.

func (*Config) UnmarshalYAML added in v0.2.0

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type Storage

type Storage interface {

	// Shutdown shuts down storage sub system.
	Shutdown()
	// contains filtered or unexported methods
}

Storage represents an entity storage interface.

func Instance

func Instance() Storage

Instance returns global storage sub system.

type StorageType added in v0.2.0

type StorageType int

StorageType represents a storage manager type.

const (
	// MySQL represents a MySQL storage type.
	MySQL StorageType = iota

	// BadgerDB represents a BadgerDB storage type.
	BadgerDB

	// Memory represents a in-memstorage storage type.
	Memory
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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