type StaticTokenProvider struct { Token Token }
StaticTokenProvider provides a utility for wrapping a static bearer token value within an implementation of a token provider.
func (s StaticTokenProvider) RetrieveBearerToken(aws.Context) (Token, error)
RetrieveBearerToken returns the static token specified.
type Token struct { Value string CanExpire bool Expires time.Time }
Token provides a type wrapping a bearer token and expiration metadata.
func (t Token) Expired(now time.Time) bool
Expired returns if the token's Expires time is before or equal to the time provided. If CanExpire is false, Expired will always return false.
type TokenProvider interface { RetrieveBearerToken(aws.Context) (Token, error) }
TokenProvider provides interface for retrieving bearer tokens.
type TokenProviderFunc func(aws.Context) (Token, error)
TokenProviderFunc provides a helper utility to wrap a function as a type that implements the TokenProvider interface.
func (fn TokenProviderFunc) RetrieveBearerToken(ctx aws.Context) (Token, error)
RetrieveBearerToken calls the wrapped function, returning the Token or error.