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.
Click to show internal directories.
Click to hide internal directories.