vault-plugin-auth-gcp: github.com/hashicorp/vault-plugin-auth-gcp/plugin/cache Index | Files

package cache

import "github.com/hashicorp/vault-plugin-auth-gcp/plugin/cache"

Index

Package Files

cache.go

type Cache Uses

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

Cache is the internal cache implementation.

func New Uses

func New() *Cache

New creates a cacher.

func (*Cache) Clear Uses

func (c *Cache) Clear()

Clear empties the cache for all values.

func (*Cache) Expire Uses

func (c *Cache) Expire(name string)

Expire removes the given item from the cache, if it exists.

func (*Cache) Fetch Uses

func (c *Cache) Fetch(name string, t time.Duration, f Func) (interface{}, error)

Fetch retrieves an item from the cache. If the item exists in the cache and is within its lifetime, it is returned. If the item does not exist, or if the item exists but has exceeded its lifetime, the function f is invoked and the result is updated in the cache.

type Func Uses

type Func func() (interface{}, error)

Func is the signature for a cache function.

Package cache imports 2 packages (graph) and is imported by 2 packages. Updated 2019-04-30. Refresh now. Tools for package owners.