cache

package
v0.0.0-...-a743c3d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Apply

func (c *Cache) Apply(log *raft.Log) any

func (*Cache) Del

func (c *Cache) Del(key string) error

func (*Cache) Dump

func (c *Cache) Dump() <-chan string

func (*Cache) Get

func (c *Cache) Get(key string) (*CacheValue, error)

func (*Cache) Has

func (c *Cache) Has(key string) bool

func (*Cache) Restore

func (c *Cache) Restore(snapshot io.ReadCloser) error

func (*Cache) Set

func (c *Cache) Set(key string, value *CacheValue) error

func (*Cache) Snapshot

func (c *Cache) Snapshot() (raft.FSMSnapshot, error)

type CacheValue

type CacheValue struct {
	Kind  datatypes.DataType
	Value any
}

Jump to

Keyboard shortcuts

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