Documentation
¶
Index ¶
- Constants
- func JSONDecode(data, output interface{}) error
- type APIError
- type Chat
- func (chat *Chat) Call(desc turnpike.Call, output interface{}) error
- func (chat *Chat) GetChannel(call turnpike.Call) (*ChatChannel, error)
- func (chat *Chat) GetUsers(desc turnpike.Call) ([]*User, error)
- func (chat *Chat) IterMessages(desc turnpike.Call) <-chan Result[*ChatEvent]
- func (chat *Chat) ListMessages(desc turnpike.Call) ([]*ChatEvent, int64, int64, error)
- func (chat *Chat) OnChanneEvent(channel string, handle func(event *ChatEvent) error) (func(), error)
- func (chat *Chat) OnChannelInvite(handle func(eventType int, channel *ChatChannel) error) (func(), error)
- func (chat *Chat) OnChannelUpdate(handle func(eventType int, channel *ChatChannel) error) (func(), error)
- func (chat *Chat) Publish(desc turnpike.Publish) error
- func (chat *Chat) Subscribe(desc turnpike.Subscribe, handle EventHandler) (func(), error)
- type ChatChannel
- type ChatChannelPage
- type ChatEvent
- type Client
- func (client *Client) Chat() (*Chat, error)
- func (client *Client) DMChannelName(them ...string) string
- func (client *Client) ExploreChatChannelPage(requet compose.Request) (*Page[ChatChannel], error)
- func (client *Client) ExploreContentPage(requet compose.Request) (*Page[Content], error)
- func (client *Client) ExploreUserPage(requet compose.Request) (*Page[User], error)
- func (client *Client) GetChannels(desc compose.Request) ([]*ChatChannel, error)
- func (client *Client) GetChannelsPage(desc compose.Request) (*Page[ChatChannel], error)
- func (client *Client) GetCommentPage(request compose.Request) (*Page[Comment], error)
- func (client *Client) GetContent(id string) (*Content, error)
- func (client *Client) GetFeedPage(request compose.Request) (*Page[Content], error)
- func (client *Client) GetUser(desc compose.Request) (*User, error)
- func (client *Client) IterChannelsQuery(query string) <-chan Result[*ChatChannel]
- func (client *Client) IterComments(id string) <-chan Result[*Comment]
- func (client *Client) IterExploreChatChannel(compilation string) <-chan Result[*ChatChannel]
- func (client *Client) IterExploreContent(compilation string) <-chan Result[*Content]
- func (client *Client) IterExploreUser(compilation string) <-chan Result[*User]
- func (client *Client) IterFeed(feed string) <-chan Result[*Content]
- func (client *Client) IterTimeline(id string) <-chan Result[*Content]
- func (client *Client) RequestJSON(desc compose.Request, output interface{}) error
- type Comment
- type Content
- type Cursor
- type EventHandler
- type Iterator
- type Page
- type Result
- type User
Constants ¶
View Source
const ( UNK_0 messageType = iota TEXT_MESSAGE UNK_2 JOIN_CHANNEL EXIT_CHANNEL )
View Source
const ( CONTENT_PIC = "pic" CONTENT_VIDEO_CLIP = "video_clip" CONTENT_COMICS = "comics" // created from the in-app comic maker )
TODO types of content, missing a bunch of content types an enum type when we have all of them ( will we ever? )
View Source
const ( EVENT_UNKNOWN = -1 EVENT_JOIN = 100 EVENT_EXIT = 101 EVENT_MESSAGE = 200 EVENT_INVITED = 300 )
View Source
const (
LogLevel = logrus.InfoLevel
)
Variables ¶
This section is empty.
Functions ¶
func JSONDecode ¶
func JSONDecode(data, output interface{}) error
Types ¶
type APIError ¶ added in v0.0.4
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func (*Chat) GetChannel ¶
func (chat *Chat) GetChannel(call turnpike.Call) (*ChatChannel, error)
func (*Chat) IterMessages ¶
func (*Chat) ListMessages ¶
func (*Chat) OnChanneEvent ¶
func (*Chat) OnChannelInvite ¶
func (chat *Chat) OnChannelInvite(handle func(eventType int, channel *ChatChannel) error) (func(), error)
func (*Chat) OnChannelUpdate ¶
func (chat *Chat) OnChannelUpdate(handle func(eventType int, channel *ChatChannel) error) (func(), error)
type ChatChannel ¶
type ChatChannel struct { Name string `json:"name"` Title string `json:"title"` MembersOnline int `json:"members_online"` MembersTotal int `json:"members_total"` Type compose.ChannelType `json:"type"` JoinState compose.ChannelJoinState `json:"join_state"` Role compose.ChannelRole `json:"role"` TouchDT int64 `json:"touch_dt"` // maybe when we last were online ?? User struct { ID string `json:"id"` Nick string `json:"nick"` LastSeenAt int64 `json:"last_seen_at"` IsVerified bool `json:"is_verified"` } `json:"user"` }
type ChatChannelPage ¶
type ChatChannelPage struct { Channels struct { Items []*ChatChannel `json:"items"` Paging Cursor `json:"paging"` } `json:"channels"` Num int `json:"num"` }
type ChatEvent ¶
type ChatEvent struct { ID string `json:"id"` Text string `json:"text"` Type messageType `json:"type"` Status int `json:"status"` PubAt float64 `json:"pub_at"` User struct { ID string `json:"user"` Nick string `json:"nick"` IsVerified bool `json:"is_verified"` LastSeenAt int64 `json:"last_seen_at"` } `json:"user"` Channel string }
type Client ¶
type Client struct { Self *User // contains filtered or unexported fields }
func MakeClient ¶
func MakeClientLog ¶
func (*Client) DMChannelName ¶
func (*Client) ExploreChatChannelPage ¶ added in v0.0.9
func (*Client) ExploreContentPage ¶ added in v0.0.9
func (*Client) ExploreUserPage ¶ added in v0.0.9
func (*Client) GetChannels ¶
func (client *Client) GetChannels(desc compose.Request) ([]*ChatChannel, error)
func (*Client) GetChannelsPage ¶
func (*Client) GetCommentPage ¶ added in v0.0.7
func (*Client) GetFeedPage ¶
func (*Client) IterChannelsQuery ¶ added in v0.0.9
func (client *Client) IterChannelsQuery(query string) <-chan Result[*ChatChannel]
func (*Client) IterComments ¶ added in v0.0.7
func (*Client) IterExploreChatChannel ¶ added in v0.0.9
func (client *Client) IterExploreChatChannel(compilation string) <-chan Result[*ChatChannel]
func (*Client) IterExploreContent ¶ added in v0.0.9
func (*Client) IterExploreUser ¶ added in v0.0.9
func (*Client) IterTimeline ¶ added in v0.0.9
type Comment ¶ added in v0.0.7
type Comment struct { ID string `json:"id"` CID string `json:"cid"` State string `json:"state"` Date int `json:"date"` Text string `json:"text"` IsReply bool `json:"is_reply"` IsSmiled bool `json:"is_smiled"` IsUnsmiled bool `json:"is_unsmiled"` IsEdited bool `json:"is_edited"` RootCommID string `json:"root_comm_id"` ParentCommID string `json:"parent_comm_id"` Depth int `json:"depth"` User User `json:"user"` Num struct { Smiles int `json:"smiles"` Unsmiles int `json:"unsmiles"` Replies int `json:"replies"` } `json:"num"` Attachments struct { MentionUser []struct { ID string `json:"id"` UserID string `json:"user_id"` Nick string `json:"nick"` Start int `json:"start_index"` Stop int `json:"stop_index"` OriginalNick string `json:"original_nick"` } `json:"mention_user"` } `json:"attachments"` ContentThumbs struct { URL string `json:"url"` LargeURL string `json:"large_url"` X640URL string `json:"x640_url"` WebpURL string `json:"webp_url"` LargeWebpURL string `json:"large_webp_url"` X640WebpURL string `json:"x640_webp_url"` ProportionalURL string `json:"proportional_url"` ProportionalWebpURL string `json:"proportional_webp_url"` ProportionalSize struct { Width int `json:"w"` Height int `json:"h"` } `json:"proportional_size"` } `json:"content_thumbs"` }
type Content ¶
type Content struct { Type string `json:"type"` ID string `json:"id"` Link string `json:"link"` DateCreated int64 `json:"date_created"` PublushAt int64 `json:"publish_at"` Tags []string `json:"tags"` State string `json:"state"` ShotStatus string `json:"shot_status"` FastStart bool `json:"fast_start"` IsFeatured bool `json:"is_featured"` IsPinned bool `json:"is_pinned"` IsAbused bool `json:"is_abused"` IsUnsafe bool `json:"is_unsafe"` IsRepublished bool `json:"is_republished"` IsSmiled bool `json:"is_smiled"` IsUnsmiled bool `json:"is_unsmiled"` Size struct { Height int `json:"h"` Width int `json:"w"` } `json:"size"` Num struct { Comments int `json:"comments"` Republished int `json:"republished"` Smiles int `json:"smiles"` Unsmiles int `json:"unsmiles"` Views int `json:"views"` } `json:"num"` Creator struct { ID string `json:"id"` Nick string `json:"nick"` } `json:"creator"` // type = pic|comics Pic struct { WebpURL string `json:"webp_url"` } `json:"pic,omitempty"` // type = video_clip VideoClip struct { ScreenURL string `json:"screen_url"` SourceType string `json:"source_type"` Bytes int `json:"bytes"` Duration int `json:"duration"` } `json:"video_clip,omitempty"` }
type EventHandler ¶
type Page ¶ added in v0.0.7
type Page[T Comment | Content | User | ChatChannel] struct { Items []T `json:"items"` Paging Cursor `json:"paging"` }
type User ¶
type User struct { Email string `json:"email"` SafeMode bool `json:"safe_mode"` OriginalNick string `json:"original_nick"` MessagingPrivacy string `json:"messaging_privacy_status"` ID string `json:"id"` Nick string `json:"nick"` About string `json:"about"` IsAvailableForChat bool `json:"is_available_for_chat"` IsBanned bool `json:"is_banned"` IsDeleted bool `json:"is_deleted"` IsModerator bool `json:"is_moderator"` IsVerified bool `json:"is_verified"` IsInSubscribers bool `json:"is_in_subscribers"` IsInSubscriptions bool `json:"is_in_subscriptions"` IsSubscribedToUpdates bool `json:"is_subscribed_to_updates"` IsPrivate bool `json:"is_private"` Num struct { Subscriptions int `json:"subscriptions"` Subscribers int `json:"subscribers"` TotalPosts int `json:"total_posts"` Created int `json:"created"` Featured int `json:"featured"` TotalSmiles int `json:"total_smiles"` Achievements int `json:"achievements"` } `json:"num"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.