Documentation ¶
Index ¶
- Variables
- type Client
- func (cli *Client) Communities() []Community
- func (cli *Client) CurrentCommunity() Community
- func (cli *Client) CurrentCommunityIndex() int
- func (cli *Client) GetCommunityById(id string) (Community, bool)
- func (cli *Client) Id() string
- func (cli *Client) IsLoggedIn() bool
- func (cli *Client) LikeCCPPosts(count int) int
- func (cli *Client) LikeMoments(count int) int
- func (cli *Client) LikeNotices(count int) int
- func (cli *Client) LikeProposals(count int) int
- func (cli *Client) SetCurrentCommunity(i int) error
- func (cli *Client) SetCurrentCommunityById(id string) error
- func (cli *Client) SetTimeout(d time.Duration)
- func (cli *Client) StartQRLogin(onLogin LoginHandler) (string, error)
- func (cli *Client) StopQRLogin()
- type Community
- type LikedPost
- type LikedPostsHistory
- type LoginHandler
- type NullLikedPostsHistory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrQRLoginAlreadyStarted = errors.New("qr login already started") ErrNotLoggedIn = errors.New("not logged in") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(history LikedPostsHistory) *Client
NewClient creates a client with the DAO. A DAO is used for speeding up the liking process by ignoring already liked posts.
func (*Client) Communities ¶
func (*Client) CurrentCommunity ¶
func (*Client) CurrentCommunityIndex ¶
func (*Client) IsLoggedIn ¶
func (*Client) LikeCCPPosts ¶
func (*Client) LikeMoments ¶
func (*Client) LikeNotices ¶
LikeNotices visits count of the latest notices and returns the number of posts that have been liked
func (*Client) LikeProposals ¶
func (*Client) SetCurrentCommunity ¶
SetCurrentCommunity sets the current community at the given index
func (*Client) SetCurrentCommunityById ¶
func (*Client) SetTimeout ¶
func (*Client) StartQRLogin ¶
func (cli *Client) StartQRLogin(onLogin LoginHandler) (string, error)
StartQRLogin starts the qr login process and returns the url of the qr code. If the login already started, ErrQRLoginAlreadyStarted is returned
func (*Client) StopQRLogin ¶
func (cli *Client) StopQRLogin()
type LikedPostsHistory ¶
type LoginHandler ¶
type LoginHandler func()
type NullLikedPostsHistory ¶
type NullLikedPostsHistory struct{}
func (NullLikedPostsHistory) Add ¶
func (o NullLikedPostsHistory) Add(post LikedPost) error
Click to show internal directories.
Click to hide internal directories.