cache

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key interface{}) (interface{}, bool)
	SetWithTTL(key, value interface{}, cost int64, ttl time.Duration) bool
	Del(key interface{})
}

Cache represents caching functionality. Concrete implementation is expected to be thread-safe, and clean up items when ttl is expired.

type Provider

type Provider struct {
	Cache Cache
}

Provider provides cache support for sensitive data like unencrypted keys from KeyManager, and Shamir secret shares.

func (*Provider) Wrap

func (p *Provider) Wrap(provider ShamirProvider, cacheTTL time.Duration) ShamirProvider

Wrap adds caching support to the underlying ShamirProvider.

type ShamirProvider

type ShamirProvider = shamir.Provider

ShamirProvider is an alias for shamir.Provider.

Jump to

Keyboard shortcuts

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