client

package
v0.0.0-...-d578c97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOffline = "offline"
	StatusAway    = "away"
	StatusActive  = "active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatMessage

type ChatMessage struct {
	Contents []Content `msgpack:"contents"`
	Time     time.Time `msgpack:"time"`
}

func NewChatMessage

func NewChatMessage(contents []Content) ChatMessage

NewChatMessage generates a new ChatMessage with the given Content array.

func NewHTMLChatMessage

func NewHTMLChatMessage(html string) ChatMessage

NewHTMLChatMessage generates a new ChatMessage with a html text.

func NewMimeChatMessage

func NewMimeChatMessage(mimetype string, data string) ChatMessage

NewMimeChatMessage generates a new ChatMessage with the given mimetype.

func NewPlainChatMessage

func NewPlainChatMessage(text string) ChatMessage

NewPlainChatMessage generates a new ChatMessage with a plain text.

func (*ChatMessage) At

func (m *ChatMessage) At(i int) (Content, error)

At returns the content at position i in the message.

func (*ChatMessage) First

func (m *ChatMessage) First(mimetype string) (string, error)

First returns the first content that has the given mimetype.

func (*ChatMessage) HTML

func (m *ChatMessage) HTML() string

HTML returns the first text/html content.

func (*ChatMessage) Len

func (m *ChatMessage) Len() int

Len returns the number of contents.

func (*ChatMessage) Push

func (m *ChatMessage) Push(c Content)

Push adds a new content to the message.

func (*ChatMessage) Text

func (m *ChatMessage) Text() string

Text returns the first text/plain content.

type Content

type Content struct {
	Mime string `msgpack:"mime"`
	Data string `msgpack:"data"`
}

type MessageAck

type MessageAck struct {
}

type Roster

type Roster struct {
	// contains filtered or unexported fields
}

Roster represents a contact list.

func (*Roster) Add

func (r *Roster) Add(id utils.NodeID)

func (*Roster) List

func (r *Roster) List() []utils.NodeID

func (*Roster) Remove

func (r *Roster) Remove(id utils.NodeID) error

type UserAvatar

type UserAvatar struct {
	Image image.Image
}

type UserPresence

type UserPresence struct {
	Status UserStatus `msgpack:"status"`
	Ack    bool       `msgpack:"ack"`
}

type UserProfile

type UserProfile struct {
	Nickname  string            `msgpack:"nickname"`
	Avatar    UserAvatar        `msgpack:"avatar"`
	Extension map[string]string `msgpack:"ext"`
}

type UserProfileRequest

type UserProfileRequest struct {
}

type UserProfileResponse

type UserProfileResponse struct {
	Profile UserProfile `msgpack:"profile"`
}

type UserStatus

type UserStatus struct {
	Type    string `msgpack:"type"`
	Message string `msgpack:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL