storage

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Marshaller
}

File storage configuration.

func NewJSONFile

func NewJSONFile() File

NewJSONFile default JSON storage implementation.

func (File) Load

func (f File) Load(v interface{}, path string) error

Load loads data from disk.

func (File) Save

func (f File) Save(v interface{}, path string) error

Save stores data to disk.

type Marshaller

type Marshaller interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
}

Marshaller encodes/decodes interfaces to/from byte arrays.

Jump to

Keyboard shortcuts

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