storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStorage is used to wrap general storage errors.
	ErrStorage = errors.New("storage error")
	// ErrStorageSourceNotFound is returned when storage source cannot be found.
	ErrStorageSourceNotFound = errors.New("data source could not be found")
)

Functions

This section is empty.

Types

type FileSystem

type FileSystem struct {
	// contains filtered or unexported fields
}

FileSystem represents a storage in a file.

func NewFileSystem

func NewFileSystem(path string, options ...FileSystemOption) FileSystem

NewFileSystem creates a new File storage.

func (FileSystem) Load

func (f FileSystem) Load() ([]byte, error)

Load data from the file.

func (FileSystem) Save

func (f FileSystem) Save(data []byte) error

Save data to the file.

func (FileSystem) Updated

func (f FileSystem) Updated() (time.Time, error)

Updated returns the time the file was last modified.

type FileSystemOption

type FileSystemOption func(options *FileSystemOptions)

FileSystemOption sets an option to the FileSystemOptions.

type FileSystemOptions

type FileSystemOptions struct{}

FileSystemOptions contains options for the file storage.

Jump to

Keyboard shortcuts

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