cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Policy cache package maintains local a local copy of all romana policies and provides updates when a policy added/deleted/modified. Useful for the clients who lists entire policy storage often.

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 implements Interface.

func (*Cache) List

func (c *Cache) List() []common.Policy

List implements Interface.

func (*Cache) Run

func (c *Cache) Run(stop <-chan struct{}) <-chan string

Run implements Interface.

type Config

type Config struct {
	// CacheTickSeconds is a delay before attempts to refresh the cache.
	CacheTickSeconds int
}

Config represents configuration for the policy cache.

type Interface

type Interface interface {
	// Run starts main loop that synchronizes internal cache
	// with Policy service periodically and generates
	// notification if cache was updated.
	Run(stop <-chan struct{}) <-chan string

	// List returns a list of all romana policies in a cache.
	List() []common.Policy
}

Interface defines policy cache behavior.

func New

func New(client *common.RestClient, config Config) Interface

New creates new policy cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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