authtoken

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRefreshDurationFunc = func(token interfaces.AuthToken) time.Duration {
		return time.Until(token.ExpiresOn) / 2
	}
	DefaultCreateTicker    = time.Tick
	DefaultRefreshDuration = time.Second * 30
)

Functions

func NewWriter

func NewWriter(factory func() (io.WriteCloser, error)) interfaces.AuthTokenWriter

Types

type CreateTickerFuncType

type CreateTickerFuncType func(time.Duration) <-chan time.Time

type Factory

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

func NewFactory

func NewFactory(filePath string) Factory

func (Factory) Create

func (w Factory) Create() (io.WriteCloser, error)

type RefreshDurationFuncType

type RefreshDurationFuncType func(token interfaces.AuthToken) time.Duration

type Refresher

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

func NewAuthTokenRefresher

func NewAuthTokenRefresher(tokenProvider interfaces.AuthTokenProvider,
	writer interfaces.AuthTokenWriter,
	refreshCalculate RefreshDurationFuncType,
	createTicker CreateTickerFuncType) *Refresher

func (*Refresher) RefreshToken

func (at *Refresher) RefreshToken(ctx context.Context) error

type Writer

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

func (*Writer) WriteToken

func (w *Writer) WriteToken(token interfaces.AuthToken) error

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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