store

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = map[string]func(...string) StoreDriver{
	"memory": func(...string) StoreDriver {
		return &MemoryStore{}
	},
}

Functions

This section is empty.

Types

type MemoryStore

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

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(key string)

func (*MemoryStore) Exist

func (s *MemoryStore) Exist(key string) bool

func (*MemoryStore) Get

func (s *MemoryStore) Get(key string) interface{}

func (*MemoryStore) Range

func (s *MemoryStore) Range(callback func(string, interface{}) bool)

func (*MemoryStore) Set

func (s *MemoryStore) Set(key string, value interface{})

type MemoryStoreFactory

type MemoryStoreFactory struct{}

func (MemoryStoreFactory) New

type StoreDriver

type StoreDriver interface {
	Get(key string) interface{}
	Set(key string, value interface{})
	Delete(key string)
	Exist(key string) bool
	Range(callback func(string, interface{}) bool)
}

type StoreFactory

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

func NewStoreFactory

func NewStoreFactory(factory map[string]func(...string) StoreDriver) *StoreFactory

func (*StoreFactory) New

func (f *StoreFactory) New(name string, args ...string) StoreDriver

Jump to

Keyboard shortcuts

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