storage

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type     StorageType
	Location string
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) Apply

func (c *Config) Apply(other *Config)

func (*Config) Check

func (c *Config) Check() error

func (*Config) String

func (c *Config) String() string

type Storage

type Storage interface {
	ReadData(key string) ([]byte, error)
	WriteData(key string, val []byte) error
}

Storage interface allows to read and write serialized data

func NewDefaultStorage

func NewDefaultStorage() Storage

func NewStorage

func NewStorage(cfg *Config) (Storage, error)

type StorageType

type StorageType string
const (
	TypeFile  StorageType = "file"
	TypeInMem StorageType = "inmem"
)

Jump to

Keyboard shortcuts

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