Documentation
¶
Index ¶
Constants ¶
View Source
const ( EventMessage = 1 EventTyping = 2 EventStartSpinOff = 3 )
event codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticater ¶
Authenticater provides methods to check that a user has provided proper login information or a valid token.
type Channel ¶
type Channel struct {
ID string `json:"id"`
Name string `json:"name"`
Details string `json:"details"`
Image string `json:"display_image"`
IsSidebar bool `json:"is_sidebar"`
Parent string `json:"parent"`
Direct bool `json:"direct"`
Resolved bool `json:"resolved"`
}
Channel contains a chat centered around a specific topic.
type ChannelUpdate ¶
ChannelUpdate is sent over the Websocket connection to alert users of new channels, updates to an existing channel's information, etc.
type ChatMessage ¶
type ChatMessage struct {
ID string `json:"id"`
Event int64 `json:"event"`
Content string `json:"content"`
ToUser string `json:"to_user"`
FromUser string `json:"from_user"`
Channel string `json:"channel"`
}
ChatMessage represents a message sent over the Websocket connection.
type Creater ¶
type Creater interface {
CreateWorkspace(*Workspace) (*Workspace, error)
CreateUser(*User) (*User, error)
CreateChannel(*Channel, string) (*Channel, error)
CreateMessage(*ChatMessage) (*ChatMessage, error)
}
Creater provides methods to create new objects that will be persisted to disk.
type Getter ¶
type Getter interface {
GetWorkspacesForUser(string) ([]*Workspace, error)
GetWorkspaces() ([]*Workspace, error)
GetDefaultWorkspace() (*Workspace, error)
GetUser(string) (*User, error)
GetChannel(string) (*Channel, error)
GetMessage(string) (*ChatMessage, error)
GetUsers(string) ([]*User, error)
GetChannels(string) ([]*Channel, error)
GetMessages(string) ([]*ChatMessage, error)
GetUsersInChannel(string, string) ([]*User, error)
GetChannelsForUser(string, string) ([]*Channel, error)
GetMessagesInChannel(string, string) ([]*ChatMessage, error)
GetMessagesFromUser(string, string) ([]*ChatMessage, error)
GetMessagesToUser(string, string) ([]*ChatMessage, error)
}
type User ¶
type User struct {
ID string `json:"id"`
DisplayName string `json:"display_name"`
Email string `json:"email"`
Password []byte `json:"-"`
ProfileImg string `json:"profile_image"`
}
User represents a basic user of sidebar. They can be members of multiple channels, sidebars, etc.
type WebsocketMessage ¶
type WebsocketMessage struct {
// Type of message so receiver can decide how to decode
Type string
// information being sent
Payload interface{}
}
WebsocketMessage represents anything that can be sent over the Websocket connection.
Click to show internal directories.
Click to hide internal directories.
