Documentation ¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶ added in v0.11.2
type AuthToken struct { Token string // The authentication token string. ExpiresOn time.Time // The expiration time of the token. }
An AuthToken is an authentication token used to communicate with the hub API server.
type Provider ¶ added in v0.11.2
type Provider interface { // FetchToken fetches an authentication token to make requests to its associated fleet's hub cluster. // It returns the token for a given input context, or an error if the retrieval fails. FetchToken(ctx context.Context) (AuthToken, error) }
Provider defines a method for fetching an authentication token.
type RefreshDurationFuncType ¶
type Refresher ¶
type Refresher struct {
// contains filtered or unexported fields
}
func NewAuthTokenRefresher ¶
func NewAuthTokenRefresher(tokenProvider Provider, writer Writer, refreshCalculate RefreshDurationFuncType, createTicker CreateTickerFuncType) *Refresher
type TokenWriter ¶ added in v0.11.2
type TokenWriter struct {
// contains filtered or unexported fields
}
func (*TokenWriter) WriteToken ¶ added in v0.11.2
func (w *TokenWriter) WriteToken(token AuthToken) error
type Writer ¶
type Writer interface { // WriteToken writes the provided authentication token to a filepath location specified in a TokenWriter. // It returns an error if the writing process fails. WriteToken(token AuthToken) error }
Writer defines a method for writing an authentication token to a specified location.
Click to show internal directories.
Click to hide internal directories.