token_generator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITokenGenerator

type ITokenGenerator interface {
	RequestBearerToken() (*RequestBearerTokenResponse, error)
	SetApiKeyAndSecret(apiKey, apiSecret string) ITokenGenerator
}

ITokenGenerator is the interface that TokenGenerator implements.

func NewTokenGenerator

func NewTokenGenerator(httpClient httpclient.IHttpClient) ITokenGenerator

type RequestBearerTokenResponse

type RequestBearerTokenResponse struct {
	TokenType   string `json:"token_type"`
	AccessToken string `json:"access_token"`
}

type TokenGenerator

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

func (*TokenGenerator) RequestBearerToken

func (a *TokenGenerator) RequestBearerToken() (*RequestBearerTokenResponse, error)

RequestBearerToken requests a bearer token from twitter using the apiKey and apiSecret.

func (*TokenGenerator) SetApiKeyAndSecret

func (a *TokenGenerator) SetApiKeyAndSecret(apiKey, apiSecret string) ITokenGenerator

SetApiKeyAndSecret sets the apiKey and apiSecret fields for the TokenGenerator instance.

Jump to

Keyboard shortcuts

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