Back to

package tokenmanager

Latest Go to latest
Published: Feb 26, 2020 | License: Apache-2.0 | Module:


Package tokenmanager contains various implementations of manipulate.TokenManager.


type PeriodicTokenManager

type PeriodicTokenManager struct {
	// contains filtered or unexported fields

A PeriodicTokenManager issues an renew tokens periodically.

func NewPeriodicTokenManager

func NewPeriodicTokenManager(validity time.Duration, issuerFunc TokenIssuerFunc) *PeriodicTokenManager

NewPeriodicTokenManager returns a new PeriodicTokenManager backed by midgard.

func NewX509TokenManager

func NewX509TokenManager(url string, validity time.Duration, tlsConfig *tls.Config) *PeriodicTokenManager

NewX509TokenManager returns a new X509TokenManager.

func (*PeriodicTokenManager) Issue

func (m *PeriodicTokenManager) Issue(ctx context.Context) (token string, err error)

Issue issues a token.

func (*PeriodicTokenManager) Run

func (m *PeriodicTokenManager) Run(ctx context.Context, tokenCh chan string)

Run runs the token renewal job.

type TokenIssuerFunc

type TokenIssuerFunc func(context.Context, time.Duration) (string, error)

TokenIssuerFunc is the type of function that can be used to retrieve a token.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier