store

package
v0.0.0-...-fac73f2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

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

func (*MemoryStore) Close

func (m *MemoryStore) Close()

func (*MemoryStore) Flush

func (m *MemoryStore) Flush()

func (*MemoryStore) Get

func (m *MemoryStore) Get(key string) any

func (*MemoryStore) Has

func (m *MemoryStore) Has(key string) bool

func (*MemoryStore) Put

func (m *MemoryStore) Put(key string, value any, duration int)

func (*MemoryStore) Remove

func (m *MemoryStore) Remove(key string)

type Store

type Store interface {
	Put(key string, data any, duration int)
	Has(key string) bool
	Get(key string) any
	Remove(key string)
	Flush()
	Close()
}

func NewMemoryStore

func NewMemoryStore(numItems int) (Store, error)

Jump to

Keyboard shortcuts

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