cache

package
v2.0.3-beta.7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Seed Peer prefix of cache key.
	SeedPeerNamespace = "seed-peer"

	// Peer prefix of cache key.
	PeerNamespace = "peer"

	// Scheduler prefix of cache key.
	SchedulerNamespace = "scheduler"

	// Schedulers prefix of cache key.
	SchedulersNamespace = "schedulers"
)
View Source
const (
	// PeerCacheTTL is the ttl for peer cache
	PeerCacheTTL = 30 * time.Minute
)

Variables

This section is empty.

Functions

func MakeCacheKey

func MakeCacheKey(namespace string, id string) string

Make cache key

func MakePeerCacheKey added in v2.0.3

func MakePeerCacheKey(hostname, ip string) string

Make cache key for peer

func MakeSchedulerCacheKey

func MakeSchedulerCacheKey(hostname string, clusterID uint) string

Make cache key for scheduler

func MakeSchedulersCacheKey

func MakeSchedulersCacheKey(hostname, ip string) string

Make cache key for schedulers

func MakeSeedPeerCacheKey added in v2.0.3

func MakeSeedPeerCacheKey(hostname string, clusterID uint) string

Make cache key for seed peer

Types

type Cache

type Cache struct {
	*cache.Cache
	TTL time.Duration
}

Cache is cache client.

func New

func New(cfg *config.Config) (*Cache, error)

New cache instance.

Jump to

Keyboard shortcuts

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