Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextTokenSource ¶
func ContextTokenSource() scm.TokenSource
ContextTokenSource returns a TokenSource that returns a token from the http.Request context.
func StaticTokenSource ¶
func StaticTokenSource(t *scm.Token) scm.TokenSource
StaticTokenSource returns a TokenSource that always returns the same token. Because the provided token t is never refreshed, StaticTokenSource is only useful for tokens that never expire.
Types ¶
type Transport ¶
type Transport struct { // Consumer Key ConsumerKey string // Consumer Private Key PrivateKey *rsa.PrivateKey // Source supplies the Token to add to the request // Authorization headers. Source scm.TokenSource // Base is the base RoundTripper used to make requests. // If nil, http.DefaultTransport is used. Base http.RoundTripper // contains filtered or unexported fields }
Transport is an http.RoundTripper that refreshes oauth tokens, wrapping a base RoundTripper and refreshing the token if expired.
Click to show internal directories.
Click to hide internal directories.