rc

package
v0.0.0-...-97c62e0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultURL     = "http://localhost:3000"
	DefaultAPIPath = "/api/v1"
)

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	AudioURL          string    `json:"audio_url,omitempty"`
	AuthorName        string    `json:"author_name,omitempty"`
	AuthorLink        string    `json:"author_link,omitempty"`
	AuthorIcon        string    `json:"author_icon,omitempty"`
	Collapsed         bool      `json:"collapsed,omitempty"`
	Color             string    `json:"color,omitempty"`
	Fields            []Field   `json:"fields,omitempty"`
	ImageURL          string    `json:"image_url,omitempty"`
	MessageLink       string    `json:"message_link,omitempty"`
	Text              string    `json:"text,omitempty"`
	ThumbURL          string    `json:"thumb_url,omitempty"`
	Title             string    `json:"title,omitempty"`
	TitleLink         string    `json:"title_link,omitempty"`
	TitleLinkDownload bool      `json:"title_link_download,omitempty"`
	Timestamp         time.Time `json:"ts,omitempty"`
	VideoURL          string    `json:"video_url,omitempty"`
}

type Build

type Build struct {
	NodeVersion string `json:"nodeVersion"`
	Arch        string `json:"arch"`
	Platform    string `json:"platform"`
	Cpus        int64  `json:"cpus"`
}

type Client

type Client interface {
	Login() error
	Info() (*Info, error)
	GetRooms() (*Rooms, error)
	Me() (*Me, error)
	SendHook(string, Message) error
}

type Commit

type Commit struct {
	Hash    string `json:"hash"`
	Date    string `json:"date"`
	Author  string `json:"author"`
	Subject string `json:"subject"`
	Tag     string `json:"tag"`
	Branch  string `json:"branch"`
}

type Creds

type Creds struct {
	User   string
	Pass   string
	Token  string
	Method string
}

type CustomFields

type CustomFields map[string]interface{}

type Email

type Email struct {
	Address  string `json:"address"`
	Verified bool   `json:"verified"`
}

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

type Info

type Info struct {
	Success bool      `json:"success"`
	Info    InfoClass `json:"info"`
}

type InfoClass

type InfoClass struct {
	Version string `json:"version"`
	Build   Build  `json:"build"`
	Commit  Commit `json:"commit"`
}

type Me

type Me struct {
	ID               string       `json:"_id"`
	Name             string       `json:"name"`
	Emails           []Email      `json:"emails"`
	Status           string       `json:"status"`
	StatusConnection string       `json:"statusConnection"`
	Username         string       `json:"username"`
	UTCOffset        int64        `json:"utcOffset"`
	Active           bool         `json:"active"`
	Roles            []string     `json:"roles"`
	Settings         Settings     `json:"settings"`
	CustomFields     CustomFields `json:"customFields"`
	Success          bool         `json:"success"`
}

type Message

type Message struct {
	Alias       string       `json:"alias,omitempty"`
	Avatar      string       `json:"avatar,omitempty"`
	Channel     string       `json:"channel,omitempty"`
	Emoji       string       `json:"emoji,omitempty"`
	RoomID      string       `json:"room_id,omitempty"`
	Text        string       `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

type Option

type Option func(*Options)

func APIPath

func APIPath(path string) Option

func Credentials

func Credentials(user, pass, method string) Option

func Debug

func Debug(d bool) Option

func HookPath

func HookPath(path string) Option

func RegisterHook

func RegisterHook(name, hook string) Option

func Subscribe

func Subscribe(channel string) Option

func URL

func URL(url string) Option

type Options

type Options struct {
	URL      string
	APIPath  string
	HookPath string
	Channels []string
	Hooks    map[string]string

	Debug bool
	Creds Creds
}

func DefaultOptions

func DefaultOptions() *Options

type Preferences

type Preferences struct {
	EnableAutoAway              bool   `json:"enableAutoAway"`
	IdleTimeoutLimit            int64  `json:"idleTimeoutLimit"`
	DesktopNotificationDuration int64  `json:"desktopNotificationDuration"`
	AudioNotifications          string `json:"audioNotifications"`
	DesktopNotifications        string `json:"desktopNotifications"`
	MobileNotifications         string `json:"mobileNotifications"`
	UnreadAlert                 bool   `json:"unreadAlert"`
	UseEmojis                   bool   `json:"useEmojis"`
	ConvertASCIIEmoji           bool   `json:"convertAsciiEmoji"`
	AutoImageLoad               bool   `json:"autoImageLoad"`
	SaveMobileBandwidth         bool   `json:"saveMobileBandwidth"`
	CollapseMediaByDefault      bool   `json:"collapseMediaByDefault"`
	HideUsernames               bool   `json:"hideUsernames"`
	HideRoles                   bool   `json:"hideRoles"`
	HideFlexTab                 bool   `json:"hideFlexTab"`
	HideAvatars                 bool   `json:"hideAvatars"`
	RoomsListExhibitionMode     string `json:"roomsListExhibitionMode"`
	SidebarViewMode             string `json:"sidebarViewMode"`
	SidebarHideAvatar           bool   `json:"sidebarHideAvatar"`
	SidebarShowUnread           bool   `json:"sidebarShowUnread"`
	SidebarShowFavorites        bool   `json:"sidebarShowFavorites"`
	SendOnEnter                 string `json:"sendOnEnter"`
	MessageViewMode             int64  `json:"messageViewMode"`
	EmailNotificationMode       string `json:"emailNotificationMode"`
	RoomCounterSidebar          bool   `json:"roomCounterSidebar"`
	NewRoomNotification         string `json:"newRoomNotification"`
	NewMessageNotification      string `json:"newMessageNotification"`
	MuteFocusedConversations    bool   `json:"muteFocusedConversations"`
	NotificationsSoundVolume    int64  `json:"notificationsSoundVolume"`
}

type Room

type Room struct {
	ID           string                 `json:"_id"`
	Name         string                 `json:"name,omitempty"`
	Type         string                 `json:"t"`
	UpdatedAt    time.Time              `json:"_updatedAt"`
	Default      *bool                  `json:"default,omitempty"`
	Fname        *string                `json:"fname,omitempty"`
	User         *RoomUser              `json:"u,omitempty"`
	CustomFields map[string]interface{} `json:"customFields,omitempty"`
	Ro           *bool                  `json:"ro,omitempty"`
}

type RoomUser

type RoomUser struct {
	ID       string `json:"_id"`
	Username string `json:"username"`
}

type Rooms

type Rooms struct {
	Update  []Room `json:"update"`
	Remove  []Room `json:"remove"`
	Success bool   `json:"success"`
}

type Settings

type Settings struct {
	Preferences Preferences `json:"preferences"`
}

type User

type User struct {
	ID           string `json:"_id,omitempty"`
	Name         string `json:"name,omitempty"`
	UserName     string `json:"username,omitempty"`
	Status       string `json:"status,omitempty"`
	Token        string `json:"token,omitempty"`
	TokenExpires int64  `json:"tokenExpires,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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