oauth2

package
v1.5.50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

NewClient conveniently creates an oAuth2 client out of the provided factory function referred by oaccf [OAuth2ClientCreationFunc] and by using a string token provided via stp [StringTokenProvider]

If the provided context is empty, the context will be initialised with context.Background

If stp is not provided, the routine defaults to trying to retrieve tokens from default environment variables determined by [WellKnownGithubTokenVarNames]

Also if oaccf is not provided, the default oAuth2 client creation mechanism is triggered via [NewOAuthClientDefault]

func NewClientDefault

func NewClientDefault(ctx context.Context, ts goauth2.TokenSource) (api.HTTPClient, error)

NewClientDefault creates a default oAuth2 client

func NewStaticTokenSource

func NewStaticTokenSource(token string) goauth2.TokenSource

NewStaticTokenSource conveniently creates a goauth2.StaticTokenSource based on the provided token, which must be non-empty

Types

type ClientCreationFunc

type ClientCreationFunc func(ctx context.Context, ts goauth2.TokenSource) (api.HTTPClient, error)

ClientCreationFunc defines the structure of a function, which is capable for creating an oauth2 client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL