cacheetcd

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: AGPL-3.0 Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

LRU + Watch

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEtcdStore

type CacheEtcdStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, etcdDir string, cap int) (*CacheEtcdStore, error)

func (*CacheEtcdStore) Get

func (*CacheEtcdStore) PrefixGet

func (s *CacheEtcdStore) PrefixGet(ctx context.Context, prefix string) ([]storetypes.KeyValue, error)

直接从etcd prefixget, 因为 mem 中是 lru, 所以读 etcd 是必然的, 那么直接跳过 lru prefixget

func (*CacheEtcdStore) PrefixGetKey

func (s *CacheEtcdStore) PrefixGetKey(ctx context.Context, prefix string) ([]storetypes.Key, error)

直接从etcd prefixgetkey, 因为 mem 中是 lru, 所以读 etcd 是必然的, 那么直接跳过 lru prefixgetkey

func (*CacheEtcdStore) PrefixRemove

func (s *CacheEtcdStore) PrefixRemove(ctx context.Context, prefix string) ([]storetypes.KeyValue, error)

func (*CacheEtcdStore) Put

func (s *CacheEtcdStore) Put(ctx context.Context, key, value string) error

func (*CacheEtcdStore) PutWithOption

func (s *CacheEtcdStore) PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)

func (*CacheEtcdStore) Remove

func (s *CacheEtcdStore) Remove(ctx context.Context, key string) (*storetypes.KeyValue, error)

func (*CacheEtcdStore) Watch

func (s *CacheEtcdStore) Watch(ctx context.Context, key string, isPrefix bool, filterDelete bool) (storetypes.WatchChan, error)

Jump to

Keyboard shortcuts

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