Documentation ¶
Index ¶
- Constants
- func Bool(b bool) *bool
- func BoolValue(b *bool) bool
- func Float64(f float64) *float64
- func Float64Value(f *float64) float64
- func GenerateBearerToken(c IGotwiClient, apiKey, apiKeySecret string) (string, error)
- func Int(i int) *int
- func IntValue(i *int) int
- func String(s string) *string
- func StringValue(s *string) string
- func Time(t time.Time) *time.Time
- func TimeValue(t *time.Time) time.Time
- type AuthenticationMethod
- type ClientResponse
- type CreateOAuthSignatureInput
- type CreateOAuthSignatureOutput
- type Endpoint
- type EndpointInfo
- type GotwiClient
- type GotwiError
- type IGotwiClient
- type NewGotwiClientInput
- type OAuth2TokenResponse
Constants ¶
View Source
const ( APIKeyEnvName = "GOTWI_API_KEY" APIKeySecretEnvName = "GOTWI_API_KEY_SECRET" )
View Source
const ( AuthenMethodBearerToken = "Bearer Token" AuthenMethodOAuth1UserContext = "OAuth 1.0a User context" AuthenMethodOAuth2BearerToken = "OAuth 2.0 Bearer token" )
View Source
const ( OAuthVersion10 = "1.0" OAuthSignatureMethodHMACSHA1 = "HMAC-SHA1" )
View Source
const OAuth2TokenEndpoint = "https://api.twitter.com/oauth2/token"
Variables ¶
This section is empty.
Functions ¶
func Float64Value ¶
func GenerateBearerToken ¶
func GenerateBearerToken(c IGotwiClient, apiKey, apiKeySecret string) (string, error)
func StringValue ¶
Types ¶
type AuthenticationMethod ¶
type AuthenticationMethod string
func (AuthenticationMethod) Valid ¶
func (a AuthenticationMethod) Valid() bool
type ClientResponse ¶
type CreateOAuthSignatureOutput ¶
type CreateOAuthSignatureOutput struct { OAuthNonce string OAuthSignatureMethod string OAuthTimestamp string OAuthVersion string OAuthSignature string }
func CreateOAuthSignature ¶
func CreateOAuthSignature(in *CreateOAuthSignatureInput) (*CreateOAuthSignatureOutput, error)
type Endpoint ¶
type Endpoint string
func (Endpoint) Detail ¶
func (e Endpoint) Detail() (*EndpointInfo, error)
type EndpointInfo ¶
type GotwiClient ¶
type GotwiClient struct { Client *http.Client AuthenticationMethod AuthenticationMethod AccessToken string OAuthToken string SigningKey string OAuthConsumerKey string }
func NewGotwiClient ¶
func NewGotwiClient(in *NewGotwiClientInput) (*GotwiClient, error)
func (*GotwiClient) CallAPI ¶
func (c *GotwiClient) CallAPI(ctx context.Context, endpoint, method string, p util.Parameters, i util.Response) error
func (*GotwiClient) Exec ¶
func (c *GotwiClient) Exec(req *http.Request, i util.Response) (*resources.Non2XXError, error)
func (*GotwiClient) IsReady ¶
func (c *GotwiClient) IsReady() bool
type GotwiError ¶
type GotwiError struct { OnAPI bool resources.Non2XXError // contains filtered or unexported fields }
func (*GotwiError) Error ¶
func (e *GotwiError) Error() string
func (*GotwiError) Unwrap ¶
func (e *GotwiError) Unwrap() error
type IGotwiClient ¶
type NewGotwiClientInput ¶
type OAuth2TokenResponse ¶
type OAuth2TokenResponse struct { TokenType string `json:"token_type"` AccessToken string `json:"access_token"` }
func (OAuth2TokenResponse) HasPartialError ¶
func (o OAuth2TokenResponse) HasPartialError() bool
Click to show internal directories.
Click to hide internal directories.