cache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheResponse

type CacheResponse struct {
	RoleARN         string
	Audience        string
	UseRegionalSTS  bool
	TokenExpiration int64
}

type FakeServiceAccountCache

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

FakeServiceAccountCache is a goroutine safe cache for testing

func NewFakeServiceAccountCache

func NewFakeServiceAccountCache(accounts ...*v1.ServiceAccount) *FakeServiceAccountCache

func (*FakeServiceAccountCache) Add

func (f *FakeServiceAccountCache) Add(name, namespace, role, aud string, regionalSTS bool, tokenExpiration int64)

Add adds a cache entry

func (*FakeServiceAccountCache) Get

func (f *FakeServiceAccountCache) Get(name, namespace string) (role, aud string, useRegionalSTS bool, tokenExpiration int64)

Get gets a service account from the cache

func (*FakeServiceAccountCache) Pop

func (f *FakeServiceAccountCache) Pop(name, namespace string)

Pop deletes a cache entry

func (*FakeServiceAccountCache) Start

func (f *FakeServiceAccountCache) Start(chan struct{})

Start does nothing

func (*FakeServiceAccountCache) ToJSON added in v0.3.0

func (f *FakeServiceAccountCache) ToJSON() string

type ServiceAccountCache

type ServiceAccountCache interface {
	Start(stop chan struct{})
	Get(name, namespace string) (role, aud string, useRegionalSTS bool, tokenExpiration int64)
	// ToJSON returns cache contents as JSON string
	ToJSON() string
}

func New

func New(defaultAudience, prefix string, defaultRegionalSTS bool, defaultTokenExpiration int64, informer coreinformers.ServiceAccountInformer) ServiceAccountCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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