poolcache

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package poolcache implements a simple cache implementation having values mapped by two keys. As of now this package is only used by poolmanager executor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is simple cache having two keys [function][address] mapped to value and requestChannel for operation on it

func NewPoolCache

func NewPoolCache() *Cache

NewPoolCache create a Cache object

func (*Cache) DeleteValue

func (c *Cache) DeleteValue(function, address interface{}) error

DeleteValue deletes the value at key composed of [function][address]

func (*Cache) GetTotalAvailable

func (c *Cache) GetTotalAvailable(function interface{}) int

GetTotalAvailable returns a total number active function services

func (*Cache) GetValue

func (c *Cache) GetValue(function interface{}) (interface{}, error)

GetValue returns a value interface with status inActive else return error

func (*Cache) ListAvailableValue added in v1.11.1

func (c *Cache) ListAvailableValue() []interface{}

ListAvailableValue returns a list of the available function services stored in the Cache

func (*Cache) MarkAvailable

func (c *Cache) MarkAvailable(function, address interface{})

MarkAvailable marks the value at key [function][address] as available

func (*Cache) SetValue

func (c *Cache) SetValue(function, address, value interface{})

SetValue marks the value at key [function][address] as active(begin used)

Jump to

Keyboard shortcuts

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