Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthTokenProvider ¶
type AuthTokenProvider interface { // GetAccessToken returns an access token or an error. // If there is no current access token then the provider will attempt to refresh // and get a new access token. // An error is returned if there is no access token and the refresh operation fails GetAccessToken(ctx context.Context) (string, error) // RefreshAccessToken refreshes the current access token. // If there is already an existing access token that token will be returned unless // force=true is passed. // If the refresh network operation fails then an error will be returned // On successful refresh the internal state of the provider will be updated with the new token // and successive calls to GetAccessToken() will return the new token. RefreshAccessToken(ctx context.Context, force bool) (string, error) }
AuthTokenProvider is the interface which must be passed into the WithAuthToken{Unary,Stream}Interceptor so that it can authenticate outgoing requests. This is a thread-safe interface.
type Options ¶
type Options struct { // ClientID is your Stately Client ID. If not set, this is loaded from the // STATELY_CLIENT_ID environment variable when using the default // AuthTokenProvider. ClientID string // ClientSecret is your Stately Client ID. If not set, this is loaded from the // STATELY_CLIENT_SECRET environment variable when using the default // AuthTokenProvider. ClientSecret string // AuthTokenProvider handles fetching auth tokens for requests. It is // defaulted to an appropriate implementation for most services. AuthTokenProvider // Endpoint is the Stately API endpoint. // Defaults to https://api.stately.cloud Endpoint string }
Options is a set of common options for a stately API client.
func (*Options) ApplyDefaults ¶
ApplyDefaults applies the default values to the options.
func (*Options) HTTPClient ¶
HTTPClient builds an HTTP/2 client for the given options.
type OrganizationID ¶
type OrganizationID uint64
OrganizationID is a globally-unique identifier for an organization.
Click to show internal directories.
Click to hide internal directories.