Documentation ¶
Index ¶
Constants ¶
View Source
const AuthDirName = "auth"
View Source
const AuthTokenSuffix = ".token"
Variables ¶
View Source
var ErrAuthNotFound error = fmt.Errorf("authorization not found")
Functions ¶
Types ¶
type AuthClient ¶
AuthClient is an *http.Client that is able to automatically negotiate authentication with a server from an AuthStore.
type AuthStore ¶
type AuthStore interface { // Get reads and decodes the authentication token from storage. Get(scheme string, endpoint string) (*affinity.TokenInfo, error) // Set stores an authentication token. Set(token *affinity.TokenInfo, endpoint string) error }
AuthTokenStore stores authentication tokens by their scheme and endpoint.
type FileAuthStore ¶
type FileAuthStore struct {
// contains filtered or unexported fields
}
FileAuthStore stores an affinity client's authentication credential in a directory structure with file naming convention.
func NewFileAuthStore ¶
func NewFileAuthStore(baseDir string) (*FileAuthStore, error)
NewFileAuthStore creates a new FileAuthStore at the given directory.
Click to show internal directories.
Click to hide internal directories.