Documentation
¶
Index ¶
- Variables
- type APIError
- type Auth0ClientEnvEntryOption
- type BaseURLOption
- type BodyPropertiesOption
- type ClientCredentialsAndAudienceOption
- type ClientCredentialsOption
- type ClientCredentialsPrivateKeyJwtAndAudienceOption
- type ClientCredentialsPrivateKeyJwtOption
- type CustomDomainHeaderOption
- type DebugOption
- type HTTPClient
- type HTTPClientOption
- type HTTPHeaderOption
- type InsecureOption
- type MaxAttemptsOption
- type NoAuth0ClientInfoOption
- type Page
- type PageIterator
- type QueryParametersOption
- type RequestOption
- type RequestOptions
- type Response
- type TokenOption
- type UserAgentOption
Constants ¶
This section is empty.
Variables ¶
var ErrNoPages = errors.New("no pages remain")
ErrNoPages is a sentinel error used to signal that no pages remain.
This error should be used similar to io.EOF, such that it represents a non-actionable error.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Header http.Header `json:"-"`
// contains filtered or unexported fields
}
APIError is a lightweight wrapper around the standard error interface that preserves the status code from the RPC, if any.
func NewAPIError ¶
NewAPIError constructs a new API error.
type Auth0ClientEnvEntryOption ¶
Auth0ClientEnvEntryOption implements the RequestOption interface.
type BaseURLOption ¶
type BaseURLOption struct {
BaseURL string
}
BaseURLOption implements the RequestOption interface.
type BodyPropertiesOption ¶
type BodyPropertiesOption struct {
BodyProperties map[string]interface{}
}
BodyPropertiesOption implements the RequestOption interface.
type ClientCredentialsOption ¶
type CustomDomainHeaderOption ¶
type CustomDomainHeaderOption struct {
CustomDomainHeader string
}
CustomDomainHeaderOption implements the RequestOption interface.
type DebugOption ¶
type DebugOption struct {
Debug bool
}
DebugOption implements the RequestOption interface.
type HTTPClient ¶
HTTPClient is an interface for a subset of the *http.Client.
type HTTPClientOption ¶
type HTTPClientOption struct {
HTTPClient HTTPClient
}
HTTPClientOption implements the RequestOption interface.
type HTTPHeaderOption ¶
HTTPHeaderOption implements the RequestOption interface.
type InsecureOption ¶
type InsecureOption struct{}
InsecureOption implements the RequestOption interface. This option is for testing purposes only and should not be used in production.
type MaxAttemptsOption ¶
type MaxAttemptsOption struct {
MaxAttempts uint
}
MaxAttemptsOption implements the RequestOption interface.
type NoAuth0ClientInfoOption ¶
type NoAuth0ClientInfoOption struct{}
NoAuth0ClientInfoOption implements the RequestOption interface.
type Page ¶
Page represents a single page of results.
func (*Page[T]) GetNextPage ¶
GetNextPage fetches the next page, if any. If no pages remain, the ErrNoPages error is returned.
func (*Page[T]) Iterator ¶
func (p *Page[T]) Iterator() *PageIterator[T]
Iterator returns an iterator that starts at the current page.
type PageIterator ¶
type PageIterator[T any] struct { // contains filtered or unexported fields }
PageIterator is an auto-iterator for paginated endpoints.
func (*PageIterator[T]) Current ¶
func (p *PageIterator[T]) Current() T
Current returns the current element.
func (*PageIterator[T]) Err ¶
func (p *PageIterator[T]) Err() error
Err returns a non-nil error if the iterator encountered an error.
type QueryParametersOption ¶
QueryParametersOption implements the RequestOption interface.
type RequestOption ¶
type RequestOption interface {
// contains filtered or unexported methods
}
RequestOption adapts the behavior of the client or an individual request.
type RequestOptions ¶
type RequestOptions struct {
BaseURL string
HTTPClient HTTPClient
HTTPHeader http.Header
BodyProperties map[string]interface{}
QueryParameters url.Values
MaxAttempts uint
Ctx context.Context
Token string
TokenSource oauth2.TokenSource
Insecure bool // For testing purposes only - allows HTTP instead of HTTPS
// Auth0ClientEnv holds custom environment entries for the Auth0-Client header
Auth0ClientEnv map[string]string
// NoAuth0ClientInfo when true, prevents sending the "Auth0-Client" header
NoAuth0ClientInfo bool
// CustomDomainHeader is the custom domain to be sent in the "Auth0-Custom-Domain" header
// for whitelisted API endpoints
CustomDomainHeader string
}
RequestOptions defines all of the possible request options.
This type is primarily used by the generated code and is not meant to be used directly; use the option package instead.
func NewRequestOptions ¶
func NewRequestOptions(opts ...RequestOption) *RequestOptions
NewRequestOptions returns a new *RequestOptions value.
This function is primarily used by the generated code and is not meant to be used directly; use RequestOption instead.
func (*RequestOptions) ToHeader ¶
func (r *RequestOptions) ToHeader() http.Header
ToHeader maps the configured request options into a http.Header used for the request(s).
type TokenOption ¶
type TokenOption struct {
Token string
}
TokenOption implements the RequestOption interface.
type UserAgentOption ¶
type UserAgentOption struct {
UserAgent string
}
UserAgentOption implements the RequestOption interface.