Skip to content

Commit

Permalink
Elaborate commenting for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamyct committed Oct 28, 2024
1 parent f88c62e commit dee5042
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/authtoken/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ import (

// An AuthToken is an authentication token used to communicate with the hub API server.
type AuthToken struct {
Token string // name of token
ExpiresOn time.Time // expiration time of token
Token string // The authentication token string.
ExpiresOn time.Time // The expiration time of the token.
}

// Provider defines a method for fetching an AuthToken.
// Provider defines a method for fetching an authentication token.
type Provider interface {
// FetchToken fetches an AuthToken.
// It returns an error if it is unable to fetch an AuthToken for the given input context.
// 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)
}

// Writer defines a method for writing an AuthToken.
// Writer defines a method for writing an authentication token to a specified location.
type Writer interface {
// WriteToken writes an AuthToken.
// It returns an error if it is unable to write the AuthToken.
// 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
}

0 comments on commit dee5042

Please sign in to comment.