istio: istio.io/istio/mixer/pkg/checkcache Index | Files

package checkcache

import "istio.io/istio/mixer/pkg/checkcache"

Package checkcache provides a scalable cache to hold results of Mixer.Check operations.

Entries are added into the cache by supplying an attribute bag along with a ReferencedAttributes struct which determines the set of attributes in the bag should be used as a cache lookup key. Entries are looked up from the cache using an attribute bag.

Index

Package Files

cache.go keyShape.go

type Cache Uses

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

Cache holds cached results of calls to Mixer.Check

func New Uses

func New(capacity int32) *Cache

New creates a new instance of a check cache with the given maximum capacity. Adding more items to the cache then its capacity will cause eviction of older entries.

func (*Cache) Close Uses

func (cc *Cache) Close() error

Close releases any resources used by the check cache.

func (*Cache) Get Uses

func (cc *Cache) Get(attrs attribute.Bag) (Value, bool)

Get looks up an attribute bag in the cache.

func (*Cache) Set Uses

func (cc *Cache) Set(attrs attribute.Bag, value Value)

Set enters a new value in the cache.

type Value Uses

type Value struct {
    // StatusMessage for the Check operation
    StatusMessage string

    // Expiration is the point at which this cache value becomes stale and shouldn't be used
    Expiration time.Time

    // StatusCode for the Check operation
    StatusCode int32

    // ValidUseCount for the Check operation
    ValidUseCount int32

    // ReferencedAttributes for the Check operation
    ReferencedAttributes mixerpb.ReferencedAttributes

    // RouteDirective for the completed Check operation
    RouteDirective *mixerpb.RouteDirective
}

Value holds the data that the check cache stores.

Package checkcache imports 16 packages (graph) and is imported by 4 packages. Updated 2019-06-12. Refresh now. Tools for package owners.