Documentation ¶
Index ¶
- type APIError
- type Client
- type User
- type UserService
- func (s *UserService) Followers(id string) (*UsersCursor, error)
- func (s *UserService) Following(id string) (*UsersCursor, error)
- func (s *UserService) Follows(username string) error
- func (s *UserService) Info(username string) (*User, error)
- func (s *UserService) Login(email, sms, pwd string) error
- func (s *UserService) Unfollows(username string) error
- type UsersCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { User *UserService // contains filtered or unexported fields }
Client is a Gettr Client
func (*Client) SetAuthToken ¶
SetAuthToken sets the authentication username, userId and token for the actions that require permissions
type User ¶
type User struct { Description string `json:"dsc"` Nickname string `json:"nickname"` Username string `json:"username"` Following int `json:"flw"` Followers int `json:"flg"` Language string `json:"lang"` UpdateDate uint64 `json:"udate"` CreateDate uint64 `json:"cdate"` ID string `json:"_id"` }
User is an Gettr user details with description, followers/followings count, etc.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService is an API for interacting with Users details
func (*UserService) Followers ¶
func (s *UserService) Followers(id string) (*UsersCursor, error)
Followers returns a Cursor to the list of followers for the user id provided
func (*UserService) Following ¶
func (s *UserService) Following(id string) (*UsersCursor, error)
Following returns a Cursor to the list of Users being followed for the user id provided
func (*UserService) Follows ¶
func (s *UserService) Follows(username string) error
Follows the provided username, credentials must be set with Client.SetAuthToken
func (*UserService) Info ¶
func (s *UserService) Info(username string) (*User, error)
Info retrieves an user detail bu username (not ID)
func (*UserService) Login ¶
func (s *UserService) Login(email, sms, pwd string) error
func (*UserService) Unfollows ¶
func (s *UserService) Unfollows(username string) error
Unfollows the provided username, credentials must be set with Client.SetAuthToken
type UsersCursor ¶
UsersCursor is an iterable Cursor of Users
func (*UsersCursor) HasNext ¶
func (uc *UsersCursor) HasNext() bool
HasNext returns if there is any other page left in this result-set
func (*UsersCursor) Iter ¶
func (uc *UsersCursor) Iter(limit int) <-chan User
Iter allows a Cursor to be iterated in a for loop line any collection, abstracting out the API calls
func (*UsersCursor) Next ¶
func (uc *UsersCursor) Next() (*UsersCursor, error)
Next returns the next Cursor in a paginated resul-set