Documentation ¶
Index ¶
- Constants
- type Callbacks
- type Client
- func (c *Client) AddRoom(roomID, name, canonAlias, topic string) *Room
- func (c *Client) ConsolePrint(txtType MsgTxtType, args ...interface{})
- func (c *Client) ConsolePrintf(txtType MsgTxtType, format string, args ...interface{})
- func (c *Client) DebugBuf() *bytes.Buffer
- func (c *Client) DebugPrint(args ...interface{})
- func (c *Client) DebugPrintf(format string, args ...interface{})
- func (c *Client) GetDisplayName() string
- func (c *Client) GetPrevEvents(r *Room, num uint) (uint, error)
- func (c *Client) GetUserID() string
- func (c *Client) JoinRoom(roomIDorAlias string)
- func (c *Client) LeaveRoom(roomID string)
- func (c *Client) Login() error
- func (c *Client) SendText(roomID, body string)
- func (c *Client) StopSync()
- func (c *Client) Sync() error
- type Config
- type Event
- type Events
- func (evs *Events) Back() *list.Element
- func (evs *Events) Front() *list.Element
- func (evs *Events) Iterator() *EventsIterator
- func (evs *Events) LastEvent() *Event
- func (evs *Events) Len() int
- func (evs *Events) PushBack(e interface{})
- func (evs *Events) PushBackEvent(e *Event)
- func (evs *Events) PushFront(e interface{})
- func (evs *Events) PushFrontEvent(e *Event)
- type EventsIterator
- type ExpBackoff
- type GenMap
- type Membership
- type Message
- type MsgTxtType
- type Room
- func (r *Room) CanonAlias() string
- func (r *Room) ClearFrontEvents(n int)
- func (r *Room) DispName() string
- func (r *Room) ID() string
- func (r *Room) Mem() Membership
- func (r *Room) Name() string
- func (r *Room) PushEvent(ev *gomatrix.Event) error
- func (r *Room) PushFrontMessage(msgType, id string, ts int64, userID string, content map[string]interface{}) error
- func (r *Room) PushFrontToken(token string)
- func (r *Room) PushMessage(msgType, id string, ts int64, userID string, content map[string]interface{}) error
- func (r *Room) PushTextMessage(txtType MsgTxtType, id string, ts int64, userID, body string) error
- func (r *Room) PushToken(token string)
- func (r *Room) SetCanonAlias(alias string)
- func (r *Room) SetMembership(mem Membership)
- func (r *Room) SetName(name string)
- func (r *Room) SetTopic(topic string)
- func (r *Room) String() string
- func (r *Room) Topic() string
- type RoomState
- type Rooms
- func (rs *Rooms) AddConsoleMessage(msgType string, content map[string]interface{}) error
- func (rs *Rooms) AddConsoleTextMessage(txtType MsgTxtType, body string) error
- func (rs *Rooms) AddUpdate(myUserID *string, roomID string, mem Membership) *Room
- func (rs *Rooms) ByID(id string) *Room
- func (rs *Rooms) ByName(name string) []*Room
- func (rs *Rooms) ConsoleRoom() *Room
- func (rs *Rooms) Del(roomID string) (*Room, error)
- func (rs *Rooms) SetConsoleRoom(r *Room)
- func (rs *Rooms) SetRoomName(r *Room, name string)
- type StateRoomCanonAlias
- type StateRoomJoinRules
- type StateRoomMember
- type StateRoomName
- type StateRoomTopic
- type TextMessage
- type Token
- type User
- type Users
Constants ¶
View Source
const ( ConsoleUserID string = "@morpheus:localhost" ConsoleUserDisplayName string = "morpheus" ConsoleRoomID string = "!console:localhost" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Rs Rooms // contains filtered or unexported fields }
func (*Client) ConsolePrint ¶
func (c *Client) ConsolePrint(txtType MsgTxtType, args ...interface{})
func (*Client) ConsolePrintf ¶
func (c *Client) ConsolePrintf(txtType MsgTxtType, format string, args ...interface{})
func (*Client) DebugPrint ¶
func (c *Client) DebugPrint(args ...interface{})
func (*Client) DebugPrintf ¶
func (*Client) GetDisplayName ¶
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
func (*Events) Iterator ¶
func (evs *Events) Iterator() *EventsIterator
func (*Events) PushBackEvent ¶
func (*Events) PushFrontEvent ¶
type EventsIterator ¶
type EventsIterator struct {
// contains filtered or unexported fields
}
func (*EventsIterator) Next ¶
func (evsIt *EventsIterator) Next() *list.Element
type ExpBackoff ¶
type ExpBackoff struct {
// contains filtered or unexported fields
}
func NewExpBackoff ¶
func NewExpBackoff(max uint32) ExpBackoff
func (*ExpBackoff) Inc ¶
func (eb *ExpBackoff) Inc()
func (*ExpBackoff) Reset ¶
func (eb *ExpBackoff) Reset()
func (*ExpBackoff) Wait ¶
func (eb *ExpBackoff) Wait()
type Membership ¶
type Membership int
const ( MemInvite Membership = iota MemJoin Membership = iota MemLeave Membership = iota MemBan Membership = iota MembershipLen Membership = iota )
func (Membership) String ¶
func (mem Membership) String() string
type Message ¶
type Message struct { MsgType string //ID string //Ts int64 //Sender string Content interface{} }
type MsgTxtType ¶
type MsgTxtType int
const ( MsgTxtTypeText MsgTxtType = iota MsgTxtTypeEmote MsgTxtType = iota MsgTxtTypeNotice MsgTxtType = iota )
type Room ¶
type Room struct { Users Users //Msgs *list.List Events Events HasFirstMsg bool HasLastMsg bool Rooms *Rooms ExpBackoff ExpBackoff UI interface{} // contains filtered or unexported fields }
func NewRoom ¶
func NewRoom(rs *Rooms, id string, mem Membership, name, canonAlias, topic string) (r *Room)
func (*Room) CanonAlias ¶
func (*Room) ClearFrontEvents ¶
func (*Room) Mem ¶
func (r *Room) Mem() Membership
func (*Room) PushFrontMessage ¶
func (*Room) PushFrontToken ¶
func (*Room) PushMessage ¶
func (*Room) PushTextMessage ¶
func (*Room) SetCanonAlias ¶
func (*Room) SetMembership ¶
func (r *Room) SetMembership(mem Membership)
type Rooms ¶
type Rooms struct { R []*Room UI interface{} // contains filtered or unexported fields }
func (*Rooms) AddConsoleMessage ¶
func (*Rooms) AddConsoleTextMessage ¶
func (rs *Rooms) AddConsoleTextMessage(txtType MsgTxtType, body string) error
func (*Rooms) AddUpdate ¶
func (rs *Rooms) AddUpdate(myUserID *string, roomID string, mem Membership) *Room
Add or Update the Room
func (*Rooms) ConsoleRoom ¶
func (*Rooms) SetConsoleRoom ¶
func (*Rooms) SetRoomName ¶
type StateRoomCanonAlias ¶
type StateRoomCanonAlias struct {
Alias string
}
type StateRoomJoinRules ¶
type StateRoomJoinRules struct {
IsPublic bool
}
type StateRoomMember ¶
type StateRoomMember struct { Name string Membership Membership }
type StateRoomName ¶
type StateRoomName struct {
Name string
}
type StateRoomTopic ¶
type StateRoomTopic struct {
Topic string
}
type TextMessage ¶
type TextMessage struct { Body string Type MsgTxtType }
type User ¶
type User struct { UI interface{} // contains filtered or unexported fields }
func (*User) Mem ¶
func (u *User) Mem() Membership
type Users ¶
type Users struct { U []*User MemCount [MembershipLen]int Room *Room // contains filtered or unexported fields }
func (*Users) MemCountDelta ¶
func (us *Users) MemCountDelta(memOld, memNew Membership, deltaOld, deltaNew int)
func (*Users) SetUserName ¶
Click to show internal directories.
Click to hide internal directories.