storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpStatus

func HttpStatus(err error) int

func TestStorage

func TestStorage(s Storage) error

Types

type FS

type FS struct {
	Path string
	sync.RWMutex
}

func (*FS) Delete

func (f *FS) Delete(k string) error

func (*FS) Get

func (f *FS) Get(k string, v interface{}) error

func (*FS) Put

func (f *FS) Put(k string, v interface{}) error

type Internal

type Internal struct {
	Message string
}

func (*Internal) Error

func (i *Internal) Error() string

type Memory

type Memory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Memory) Delete

func (m *Memory) Delete(k string) error

func (*Memory) Get

func (m *Memory) Get(k string, v interface{}) error

func (*Memory) Put

func (m *Memory) Put(k string, v interface{}) error

type NotFound

type NotFound struct {
	Message string
}

func (*NotFound) Error

func (n *NotFound) Error() string

type Storage

type Storage interface {
	Put(k string, v interface{}) error
	Get(k string, v interface{}) error
	Delete(k string) error
}

Jump to

Keyboard shortcuts

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