Documentation ¶
Index ¶
- Constants
- func JSONDecode(data, output interface{}) error
- type APIContentPost
- type APIFeedPage
- type APIPaging
- 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 *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) GetChannels(desc compose.Request) ([]*ChatChannel, error)
- func (client *Client) GetChannelsPage(desc compose.Request) (*ChatChannelPage, error)
- func (client *Client) GetUser(desc compose.Request) (*User, error)
- func (client *Client) IterChannels(desc compose.Request) <-chan *ChatChannel
- func (client *Client) RequestJSON(desc compose.Request, output interface{}) error
- type EventHandler
- type User
Constants ¶
View Source
const ( UNK_0 messageType = iota TEXT_MESSAGE UNK_2 JOIN_CHANNEL EXIT_CHANNEL )
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 APIContentPost ¶
type APIContentPost struct { 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 APIFeedPage ¶
type APIFeedPage struct { Items []APIContentPost `json:"items"` Paging APIPaging `json:"paging"` }
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func (*Chat) GetChannel ¶
func (chat *Chat) GetChannel(call turnpike.Call) (*ChatChannel, error)
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 APIPaging `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) GetChannels ¶
func (client *Client) GetChannels(desc compose.Request) ([]*ChatChannel, error)
func (*Client) GetChannelsPage ¶
func (client *Client) GetChannelsPage(desc compose.Request) (*ChatChannelPage, error)
func (*Client) IterChannels ¶
func (client *Client) IterChannels(desc compose.Request) <-chan *ChatChannel
type EventHandler ¶
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"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.