storage

package
v0.0.0-...-be6fd2f Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileSystemStorage

func NewFileSystemStorage(storageDir string) (*fileSystemStorage, error)

NewFileSystemStorage Factory for fs storage saves db to `storageDir/*`

func NewMemoryStorage

func NewMemoryStorage(storageDir string) (*memoryStorage, error)

NewMemoryStorage Factory for memory storage saves db to `storageDir/memory.db`

Types

type Storage

type Storage interface {
	Put(key string, value string, expiration time.Duration) error
	Get(key string) (io.Reader, error)
	GetPattern(pattern string) (io.Reader, error)
	Delete(key string) error
	DeleteAll() error

	Type() string
	IsNotExist(err error) bool

	Flush()
}

Storage Interface for storage operations

Jump to

Keyboard shortcuts

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