gtw

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 6 Imported by: 0

README

exvi/gtw

Minimalistic Go library for Twitter v1.1/v2 API integration. Includes only certain methods I needed. It is easy to implement new endpoints if it's necessary.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolValue

func BoolValue(b *bool) bool

func Float64Value

func Float64Value(f *float64) float64

func IntValue

func IntValue(i *int) int

func StringValue

func StringValue(s *string) string

func TimeValue

func TimeValue(t *time.Time) time.Time

Types

type Client

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

func NewClient

func NewClient(apiToken string) *Client

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, params Parameters, resp interface{}) error

type PaginationMeta added in v0.3.0

type PaginationMeta struct {
	ResultCount   *int    `json:"result_count"`
	NextToken     *string `json:"next_token,omitempty"`
	PreviousToken *string `json:"previous_token,omitempty"`
}

type Parameters

type Parameters struct {
	Body        interface{}
	PathParams  map[string]string
	QueryParams map[string]string
}

type PartialError

type PartialError struct {
	ResourceType *string `json:"resource_type"`
	Field        *string `json:"field"`
	Parameter    *string `json:"parameter"`
	ResourceId   *string `json:"resource_id"`
	Title        *string `json:"title"`
	Section      *string `json:"section"`
	Detail       *string `json:"detail"`
	Value        *string `json:"value"`
	Type         *string `json:"type"`
}

type TweetRetweetedByResponse added in v0.3.0

type TweetRetweetedByResponse struct {
	Data   []User         `json:"data"`
	Meta   PaginationMeta `json:"meta,omitempty"`
	Errors []PartialError `json:"errors,omitempty"`
}

type User

type User struct {
	ID       *string `json:"id"`
	Name     *string `json:"name"`
	Username *string `json:"username"`
}

type UserFriendshipResponse added in v0.3.0

type UserFriendshipResponse struct {
	Relationship struct {
		Source struct {
			ID         string `json:"id_str"`
			Username   string `json:"screen_name"`
			Following  bool   `json:"following"`
			FollowedBy bool   `json:"followed_by"`
		} `json:"source"`
		Target struct {
			ID         string `json:"id_str"`
			Username   string `json:"screen_name"`
			Following  bool   `json:"following"`
			FollowedBy bool   `json:"followed_by"`
		} `json:"target"`
	} `json:"relationship"`
}

type UserLookupByUsernameResponse added in v0.3.0

type UserLookupByUsernameResponse struct {
	Data   User           `json:"data"`
	Errors []PartialError `json:"errors"`
}

Jump to

Keyboard shortcuts

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