Documentation ¶
Index ¶
- func ContextClient(ctx context.Context) *http.Client
- func NewClient(ctx context.Context, src Source) *http.Client
- type AuthCodeOption
- type AuthStyle
- type ContextKey
- type Endpoint
- type Oauth2
- func (o *Oauth2) AuthCodeURL(state string, opts ...AuthCodeOption) string
- func (o *Oauth2) AuthorizationCodeToken(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error)
- func (o *Oauth2) Client(ctx context.Context, t *Token) *http.Client
- func (o *Oauth2) ClientCredentialsToken(ctx context.Context, opts ...AuthCodeOption) (*Token, error)
- func (o *Oauth2) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error)
- func (o *Oauth2) StaticClient(ctx context.Context, accessToken string) *http.Client
- func (o *Oauth2) TokenSource(ctx context.Context, t *Token) Source
- type Options
- type Source
- type Token
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthCodeOption ¶
type AuthCodeOption interface {
// contains filtered or unexported methods
}
var ( AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") )
func SetAuthURLParam ¶
func SetAuthURLParam(key, value string) AuthCodeOption
type Oauth2 ¶
type Oauth2 struct {
// contains filtered or unexported fields
}
func (*Oauth2) AuthCodeURL ¶
func (o *Oauth2) AuthCodeURL(state string, opts ...AuthCodeOption) string
func (*Oauth2) AuthorizationCodeToken ¶
func (*Oauth2) ClientCredentialsToken ¶
func (*Oauth2) PasswordCredentialsToken ¶
func (*Oauth2) StaticClient ¶
type Token ¶
type Token struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Expiry time.Time `json:"expiry,omitempty"` MacKey string `json:"mac_key,omitempty"` MacAlgorithm string `json:"mac_algorithm,omitempty"` // contains filtered or unexported fields }
func RequestToken ¶
func (*Token) SetAuthHeader ¶
Click to show internal directories.
Click to hide internal directories.