Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
APIKey represents a Coinbase Cloud API Key.
func NewAPIKey ¶
func NewAPIKey(opts ...APIKeyOption) (*APIKey, error)
NewAPIKey creates a new Coinbase Cloud API Key based on the provided options.
type APIKeyClaims ¶
APIKeyClaims holds public claim values for a JWT, as well as a URI.
type APIKeyOption ¶
type APIKeyOption func(t *apiKeyConfig)
APIKeyOption is a function that applies changes to a apiKeyConfig.
func WithAPIKeyName ¶
func WithAPIKeyName(apiKeyName, apiKeyPrivateKey string) APIKeyOption
WithAPIKeyName returns an option to set the API Key.
func WithLoadAPIKeyFromEnv ¶
func WithLoadAPIKeyFromEnv(loadAPIKeyFromEnv bool) APIKeyOption
WithLoadAPIKeyFromEnv returns an option to set whether to load the API Key from environment variables. If the API Key name and private key are both set, they take precedence over the environment variables.
func WithLoadAPIKeyFromFile ¶
func WithLoadAPIKeyFromFile() APIKeyOption
WithLoadAPIKeyFromFile returns an option to set whether to load the API Key from file directly. If the API Key name and private key are both set, they take precedence over the environment variables. Next if the env vars are set they take precedence or else the file is used if set.
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator builds a JWT based on the APIKey.
func NewAuthenticator ¶
func NewAuthenticator(apiKey *APIKey) *Authenticator
NewAuthenticator returns a new Authenticator.