Documentation ¶
Index ¶
- type API
- func (a *API) GetAuthedUserFromCode(ctx context.Context, authCode string) (TwitterIdentifiers, AccessTokenResponse, error)
- func (a *API) GetFollowing(ctx context.Context) ([]TwitterIdentifiers, error)
- func (a *API) WithAuth(ctx context.Context, accessToken string, refreshToken string) (*API, *AccessTokenResponse, error)
- type AccessTokenResponse
- type ErrInvalidRefreshToken
- type GetUserFollowingResponse
- type GetUserMeResponse
- type TwitterIdentifiers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { TIDs TwitterIdentifiers // contains filtered or unexported fields }
func (*API) GetAuthedUserFromCode ¶
func (a *API) GetAuthedUserFromCode(ctx context.Context, authCode string) (TwitterIdentifiers, AccessTokenResponse, error)
GetAuthedUserFromCode creates a new twitter API client with an auth code
func (*API) GetFollowing ¶
func (a *API) GetFollowing(ctx context.Context) ([]TwitterIdentifiers, error)
func (*API) WithAuth ¶
func (a *API) WithAuth(ctx context.Context, accessToken string, refreshToken string) (*API, *AccessTokenResponse, error)
WithAuth establishes the API with an access token and refresh token, if the passed in access token is invalid, it will attempt to refresh it and optionally return the new access token and refresh token
type AccessTokenResponse ¶
type ErrInvalidRefreshToken ¶
type ErrInvalidRefreshToken struct {
// contains filtered or unexported fields
}
func (ErrInvalidRefreshToken) Error ¶
func (e ErrInvalidRefreshToken) Error() string
type GetUserFollowingResponse ¶
type GetUserFollowingResponse struct { Data []TwitterIdentifiers `json:"data"` Meta struct { ResultCount int `json:"result_count"` NextToken string `json:"next_token"` } }
type GetUserMeResponse ¶
type GetUserMeResponse struct {
Data TwitterIdentifiers `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.