Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = "hubspot.authorizer"
Functions ¶
func WithAuthorizer ¶
func WithAuthorizer(ctx context.Context, authorizer Authorizer) context.Context
WithAuthorizer appends the given authorizer to the context
Types ¶
type APIKeyAuthorizer ¶
type APIKeyAuthorizer struct {
Key string
}
func NewAPIKeyAuthorizer ¶
func NewAPIKeyAuthorizer(key string) *APIKeyAuthorizer
func (*APIKeyAuthorizer) Apply ¶
func (a *APIKeyAuthorizer) Apply(request AuthorizationRequest)
type AuthorizationRequest ¶
type AuthorizationRequest struct { QueryParams url.Values FormParams url.Values Headers map[string]string }
AuthorizationRequest represents a request that could be authorized but is not yet authorized. It only contains the fields that an authorizer may need to modify.
type Authorizer ¶
type Authorizer interface {
Apply(request AuthorizationRequest)
}
Authorizer knows how to authorize API requests to the HubSpot API by modifying the request context
type TokenAuthorizer ¶
type TokenAuthorizer struct {
Token string
}
func NewTokenAuthorizer ¶
func NewTokenAuthorizer(token string) *TokenAuthorizer
func (*TokenAuthorizer) Apply ¶
func (a *TokenAuthorizer) Apply(request AuthorizationRequest)
Click to show internal directories.
Click to hide internal directories.