statecache

package
v3.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

statecache provides a simple way to cache the current status in redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateCache

type StateCache struct {
	Prefix string // redis key prefix to use for cache entries
	Host   string // host identifier, to identifier state values from the current host
	Client *redis.Client
}

func (*StateCache) Clear

func (s *StateCache) Clear(name string)

Clear clears the cache associated with the given process and current host.

func (*StateCache) GetState

func (s *StateCache) GetState(name string) (map[string]StateInfo, error)

GetState retrieves the cached state for the given process on all nodes.

func (*StateCache) SetState

func (s *StateCache) SetState(
	name string, state state.State, rev int64)

SetState caches the given state of a process in redis.

type StateInfo

type StateInfo map[string]string

Jump to

Keyboard shortcuts

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