oauthbearer

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenProvider

func NewTokenProvider(clientID, clientSecret, tokenURL string) sarama.AccessTokenProvider

NewTokenProvider creates a new sarama.AccessTokenProvider with the provided clientID and clientSecret. The provided tokenURL is used to perform the 2 legged client credentials flow.

Types

type TokenProvider

type TokenProvider struct {
	// contains filtered or unexported fields
}

TokenProvider is a simple struct that implements sarama.AccessTokenProvider. It encapsulates an oauth2.TokenSource which is leveraged for AccessToken retrieval through the oauth2 client credentials flow, the token will auto-refresh as necessary.

func (*TokenProvider) Token

func (t *TokenProvider) Token() (*sarama.AccessToken, error)

Token returns a new *sarama.AccessToken or an error as appropriate.

Jump to

Keyboard shortcuts

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