models

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	DefaultUrl string `json:"defaultUrl"`
}

type Attachment

type Attachment struct {
	Color       string `json:"color,omitempty"`
	Text        string `json:"text,omitempty"`
	Timestamp   string `json:"ts,omitempty"`
	ThumbURL    string `json:"thumb_url,omitempty"`
	MessageLink string `json:"message_link,omitempty"`
	Collapsed   bool   `json:"collapsed"`

	AuthorName string `json:"author_name,omitempty"`
	AuthorLink string `json:"author_link,omitempty"`
	AuthorIcon string `json:"author_icon,omitempty"`

	Title             string `json:"title,omitempty"`
	TitleLink         string `json:"title_link,omitempty"`
	TitleLinkDownload string `json:"title_link_download,omitempty"`

	ImageURL string `json:"image_url,omitempty"`

	AudioURL string `json:"audio_url,omitempty"`
	VideoURL string `json:"video_url,omitempty"`

	Actions                []AttachmentAction               `json:"actions,omitempty"`
	ActionButtonsAlignment AttachmentActionButtonsAlignment `json:"button_alignment,omitempty"`

	Fields []AttachmentField `json:"fields,omitempty"`
}

Attachment Payload for postmessage rest API

https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type AttachmentAction

type AttachmentAction struct {
	Type               AttachmentActionType  `json:"type,omitempty"`
	Text               string                `json:"text,omitempty"`
	Url                string                `json:"url,omitempty"`
	ImageURL           string                `json:"image_url,omitempty"`
	IsWebView          bool                  `json:"is_webview"`
	WebviewHeightRatio string                `json:"webview_height_ratio,omitempty"`
	Msg                string                `json:"msg,omitempty"`
	MsgInChatWindow    bool                  `json:"msg_in_chat_window"`
	MsgProcessingType  MessageProcessingType `json:"msg_processing_type,omitempty"`
}

AttachmentAction are action buttons on message attachments.

type AttachmentActionButtonsAlignment

type AttachmentActionButtonsAlignment string

AttachmentActionButtonAlignment configures how the actions buttons will be aligned.

const (
	ActionButtonAlignVertical   AttachmentActionButtonsAlignment = "vertical"
	ActionButtonAlignHorizontal AttachmentActionButtonsAlignment = "horizontal"
)

type AttachmentActionType

type AttachmentActionType string
const (
	AttachmentActionTypeButton AttachmentActionType = "button"
)

type AttachmentField

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

AttachmentField Payload for postmessage rest API

https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type Channel

type Channel struct {
	ID    string `json:"_id"`
	Name  string `json:"name"`
	Fname string `json:"fname,omitempty"`
	Type  string `json:"t"`
	Msgs  int    `json:"msgs"`

	ReadOnly  bool `json:"ro,omitempty"`
	SysMes    bool `json:"sysMes,omitempty"`
	Default   bool `json:"default"`
	Broadcast bool `json:"broadcast,omitempty"`

	Timestamp *time.Time `json:"ts,omitempty"`
	UpdatedAt *time.Time `json:"_updatedAt,omitempty"`

	User        *User    `json:"u,omitempty"`
	LastMessage *Message `json:"lastMessage,omitempty"`

	Users []string `json:"usernames"`
}

type ChannelSubscription

type ChannelSubscription struct {
	ID          string   `json:"_id"`
	Alert       bool     `json:"alert"`
	Name        string   `json:"name"`
	DisplayName string   `json:"fname"`
	Open        bool     `json:"open"`
	RoomId      string   `json:"rid"`
	Type        string   `json:"c"`
	User        User     `json:"u"`
	Roles       []string `json:"roles"`
	Unread      float64  `json:"unread"`
}

type CreateChannelRequest

type CreateChannelRequest struct {
	Name     string   `json:"name"`
	Members  []string `json:"members"`
	ReadOnly bool     `json:"readOnly"`
}

type CreateGroupRequest

type CreateGroupRequest = CreateChannelRequest

type CreateUserRequest

type CreateUserRequest struct {
	Name                  string            `json:"name"`
	Email                 string            `json:"email"`
	Password              string            `json:"password"`
	Username              string            `json:"username"`
	Roles                 []string          `json:"roles,omitempty"`
	Active                *bool             `json:"active,omitempty"`
	Verified              *bool             `json:"verified,omitempty"`
	RequirePasswordChange *bool             `json:"requirePasswordChange,omitempty"`
	JoinDefaultChannels   *bool             `json:"joinDefaultChannels,omitempty"`
	CustomFields          map[string]string `json:"customFields,omitempty"`
}

type Directory

type Directory struct {
	Result []struct {
		ID        string    `json:"_id"`
		CreatedAt time.Time `json:"createdAt"`
		Emails    []struct {
			Address  string `json:"address"`
			Verified bool   `json:"verified"`
		} `json:"emails"`
		Name     string `json:"name"`
		Username string `json:"username"`
	} `json:"result"`

	Pagination
}

type Group

type Group = Channel

type Info

type Info struct {
	Version string `json:"version"`

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

	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"`
	} `json:"commit"`
}

type InviteChannelRequest

type InviteChannelRequest struct {
	RoomID string `json:"roomId"`
	UserID string `json:"userId"`
}

type InviteGroupRequest

type InviteGroupRequest = InviteChannelRequest

type Message

type Message struct {
	ID       string `json:"_id"`
	RoomID   string `json:"rid"`
	Msg      string `json:"msg"`
	EditedBy string `json:"editedBy,omitempty"`
	Type     string `json:"t,omitempty"`

	Groupable bool `json:"groupable,omitempty"`

	EditedAt  *time.Time `json:"editedAt,omitempty"`
	Timestamp *time.Time `json:"ts,omitempty"`
	UpdatedAt *time.Time `json:"_updatedAt,omitempty"`

	Mentions []User `json:"mentions,omitempty"`
	User     *User  `json:"u,omitempty"`
	PostMessage
}

type MessageProcessingType

type MessageProcessingType string
const (
	ProcessingTypeSendMessage        MessageProcessingType = "sendMessage"
	ProcessingTypeRespondWithMessage MessageProcessingType = "respondWithMessage"
)

type Pagination

type Pagination struct {
	Count  int `json:"count"`
	Offset int `json:"offset"`
	Total  int `json:"total"`
}

type Permission

type Permission struct {
	ID        string   `json:"_id"`
	UpdatedAt string   `json:"_updatedAt.$date"`
	Roles     []string `json:"roles"`
}

type PostMessage

type PostMessage struct {
	RoomID      string       `json:"roomId,omitempty"`
	Channel     string       `json:"channel,omitempty"`
	Text        string       `json:"text,omitempty"`
	ParseUrls   bool         `json:"parseUrls,omitempty"`
	Alias       string       `json:"alias,omitempty"`
	Emoji       string       `json:"emoji,omitempty"`
	Avatar      string       `json:"avatar,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

PostMessage Payload for postmessage rest API

https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type Setting

type Setting struct {
	ID           string  `json:"_id"`
	Blocked      bool    `json:"blocked"`
	Group        string  `json:"group"`
	Hidden       bool    `json:"hidden"`
	Public       bool    `json:"public"`
	Type         string  `json:"type"`
	PackageValue string  `json:"packageValue"`
	Sorter       int     `json:"sorter"`
	Value        string  `json:"value"`
	ValueBool    bool    `json:"valueBool"`
	ValueInt     float64 `json:"valueInt"`
	ValueSource  string  `json:"valueSource"`
	ValueAsset   Asset   `json:"asset"`
}

type Spotlight

type Spotlight struct {
	Users []User    `json:"users"`
	Rooms []Channel `json:"rooms"`
}

type Statistics

type Statistics struct {
	ID       string `json:"_id"`
	UniqueID string `json:"uniqueId"`
	Version  string `json:"version"`

	ActiveUsers    int `json:"activeUsers"`
	NonActiveUsers int `json:"nonActiveUsers"`
	OnlineUsers    int `json:"onlineUsers"`
	AwayUsers      int `json:"awayUsers"`
	OfflineUsers   int `json:"offlineUsers"`
	TotalUsers     int `json:"totalUsers"`

	TotalRooms                int `json:"totalRooms"`
	TotalChannels             int `json:"totalChannels"`
	TotalPrivateGroups        int `json:"totalPrivateGroups"`
	TotalDirect               int `json:"totalDirect"`
	TotlalLivechat            int `json:"totlalLivechat"`
	TotalMessages             int `json:"totalMessages"`
	TotalChannelMessages      int `json:"totalChannelMessages"`
	TotalPrivateGroupMessages int `json:"totalPrivateGroupMessages"`
	TotalDirectMessages       int `json:"totalDirectMessages"`
	TotalLivechatMessages     int `json:"totalLivechatMessages"`

	InstalledAt          time.Time `json:"installedAt"`
	LastLogin            time.Time `json:"lastLogin"`
	LastMessageSentAt    time.Time `json:"lastMessageSentAt"`
	LastSeenSubscription time.Time `json:"lastSeenSubscription"`

	Os struct {
		Type     string    `json:"type"`
		Platform string    `json:"platform"`
		Arch     string    `json:"arch"`
		Release  string    `json:"release"`
		Uptime   int       `json:"uptime"`
		Loadavg  []float64 `json:"loadavg"`
		Totalmem int64     `json:"totalmem"`
		Freemem  int       `json:"freemem"`
		Cpus     []struct {
			Model string `json:"model"`
			Speed int    `json:"speed"`
			Times struct {
				User int `json:"user"`
				Nice int `json:"nice"`
				Sys  int `json:"sys"`
				Idle int `json:"idle"`
				Irq  int `json:"irq"`
			} `json:"times"`
		} `json:"cpus"`
	} `json:"os"`

	Process struct {
		NodeVersion string  `json:"nodeVersion"`
		Pid         int     `json:"pid"`
		Uptime      float64 `json:"uptime"`
	} `json:"process"`

	Deploy struct {
		Method   string `json:"method"`
		Platform string `json:"platform"`
	} `json:"deploy"`

	Migration struct {
		ID       string    `json:"_id"`
		Version  int       `json:"version"`
		Locked   bool      `json:"locked"`
		LockedAt time.Time `json:"lockedAt"`
		BuildAt  time.Time `json:"buildAt"`
	} `json:"migration"`

	InstanceCount int       `json:"instanceCount"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"_updatedAt"`
}

type StatisticsInfo

type StatisticsInfo struct {
	Statistics Statistics `json:"statistics"`
}

type StatisticsList

type StatisticsList struct {
	Statistics []Statistics `json:"statistics"`

	Pagination
}

type UpdateUserRequest

type UpdateUserRequest struct {
	UserID string `json:"userId"`
	Data   struct {
		Name                  string            `json:"name"`
		Email                 string            `json:"email"`
		Password              string            `json:"password"`
		Username              string            `json:"username"`
		Roles                 []string          `json:"roles,omitempty"`
		Active                *bool             `json:"active,omitempty"`
		Verified              *bool             `json:"verified,omitempty"`
		RequirePasswordChange *bool             `json:"requirePasswordChange,omitempty"`
		JoinDefaultChannels   *bool             `json:"joinDefaultChannels,omitempty"`
		CustomFields          map[string]string `json:"customFields,omitempty"`
	} `json:"data"`
}

type User

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

type UserCredentials

type UserCredentials struct {
	ID    string `json:"id"`
	Token string `json:"token"`

	Email    string `json:"email"`
	Name     string `json:"name"`
	Password string `json:"pass"`
}

Jump to

Keyboard shortcuts

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