memcache

package
v0.0.0-...-544625c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DumpInterval = time.Second * 30
)

Variables

This section is empty.

Functions

func Get

func Get(key string) (string, bool)

func Init

func Init(pse PersistenStorageAdapter)

func Set

func Set(key, value string, ttl time.Duration)

Types

type GCPStorage

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

func NewGCPStorage

func NewGCPStorage(bucket *storage.BucketHandle, object string) *GCPStorage

func (*GCPStorage) DumpMemcache

func (s *GCPStorage) DumpMemcache(items []StorableItem) error

func (*GCPStorage) LoadMemcache

func (s *GCPStorage) LoadMemcache() ([]StorableItem, error)

func (*GCPStorage) NewStorableItem

func (s *GCPStorage) NewStorableItem(key, val string, expIn int64) StorableItem

type PersistenStorageAdapter

type PersistenStorageAdapter interface {
	NewStorableItem(key, val string, expIn int64) StorableItem
	LoadMemcache() ([]StorableItem, error)
	DumpMemcache([]StorableItem) error
}

type StorableItem

type StorableItem interface {
	Key() string
	Value() string
	ExpiresIn() int64
}

Jump to

Keyboard shortcuts

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