Documentation ¶
Index ¶
- Constants
- Variables
- func FullVersion() string
- type Client
- func (c *Client) Follow(nick, url string) error
- func (c *Client) GetAndSetTwter() error
- func (c *Client) Login(username, password string) (res types.AuthResponse, err error)
- func (c *Client) Post(text, as string) (res types.PostResponse, err error)
- func (c *Client) Profile(username string) (res types.ProfileResponse, err error)
- func (c *Client) Sync(delete bool, feed string, r io.Reader) (res types.SyncResponse, err error)
- func (c *Client) Timeline(page int) (res types.PagedResponse, err error)
- func (c *Client) Unfollow(nick string) error
- type Config
- type Option
Constants ¶
View Source
const (
APIVersion = 1
)
View Source
const (
// DefaultURI is the default base URI to use for the Twtxt API endpoint
DefaultURI = "http://localhost:8000/"
)
Variables ¶
View Source
var ( // DefaultUserAgent ... DefaultUserAgent = fmt.Sprintf("go.yarn.social/%s", FullVersion()) // ErrBadRequest ... ErrBadRequest = errors.New("error: bad request") ErrUnauthorized = errors.New("error: authorization failed") // ErrServerError ErrServerError = errors.New("error: server error") )
View Source
var ( // Version release version Version = "1.0.0" // Commit will be overwritten automatically by the build system Commit = "HEAD" )
Functions ¶
Types ¶
type Client ¶
type Client struct { BaseURL *url.URL Config *Config UserAgent string Twter types.Twter // contains filtered or unexported fields }
Client ...
func (*Client) Login ¶
func (c *Client) Login(username, password string) (res types.AuthResponse, err error)
Login ...
func (*Client) Post ¶
func (c *Client) Post(text, as string) (res types.PostResponse, err error)
Post ...
func (*Client) Profile ¶
func (c *Client) Profile(username string) (res types.ProfileResponse, err error)
Profile ...
Click to show internal directories.
Click to hide internal directories.