tokencache

package
v7.5.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricOperations = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "token_operation_seconds",
			Help:    "A histogram of latencies for token operations",
			Buckets: buckets,
		},
		[]string{"token", "op"},
	)
	MetricResponses = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "token_responses",
			Help: "Response codes from token operations",
		},
		[]string{"token", "op", "code"},
	)
)

Functions

This section is empty.

Types

type Cache

type Cache struct {
	token.Token
	// contains filtered or unexported fields
}

Cache keys fetched from an underlying token

func New

func New(base token.Token, expiry time.Duration) *Cache

func (*Cache) GetKey

func (c *Cache) GetKey(ctx context.Context, keyName string) (token.Key, error)

type Metrics

type Metrics struct {
	token.Token
}

Metrics wraps a token and updates metrics when methods are called

func (Metrics) GetKey

func (m Metrics) GetKey(ctx context.Context, keyName string) (key token.Key, err error)

func (Metrics) Ping

func (m Metrics) Ping(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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