gorocket

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 12 Imported by: 4

README

tests

gorocket logo

Golang Rocket Chat REST API client

Use this simple client if you need to connect to Rocket Chat in Golang.

How to use

Just import

import (
	"github.com/badkaktus/gorocket"
)

Create client

client := gorocket.NewWithOptions("https://your-rocket-chat.com", 
    gorocket.WithUserID("my-user-id"),
    gorocket.WithToken("my-bot-token"),
    gorocket.WithTimeout(1 * time.Second),
)

or

client := gorocket.NewClient("https://your-rocket-chat.com")

// login as the main admin user
login := gorocket.LoginPayload{
    User:     "admin-login",
    Password: "admin-password",
}

lg, err := client.Login(&login)

if err != nil {
    fmt.Printf("Error: %+v", err)
}
fmt.Printf("I'm %s", lg.Data.Me.Username)

Manage user

str := gorocket.NewUser{
    Email:                 "test@email.com",
    Name:                  "John Doe",
    Password:              "simplepassword",
    Username:              "johndoe",
    Active:                true,
}

me, err := client.UsersCreate(&str)
if err != nil {
    fmt.Printf("Error: %+v", err)
}
fmt.Printf("User was created %t", me.Success)

Post a message

// create a new channel
str := gorocket.CreateChannelRequest{
    Name:     "newchannel",
}

channel, err := client.CreateChannel(&str)
if err != nil {
    fmt.Printf("Error: %+v", err)
}
fmt.Printf("Channel was created %t", channel.Success)
// post a message
str := gorocket.Message{
    Channel:     "somechannel",
    Text:        "Hey! This is new message from Golang REST Client",
}

msg, err := client.PostMessage(&str)
if err != nil {
    fmt.Printf("Error: %+v", err)
}
fmt.Printf("Message was posted %t", msg.Success)

Pagination

If endpoint support pagination, you can use that like this:

// sort field in map. 1 - asc, -1 - desc
srt := map[string]int{"_updatedAt": 1, "name": -1}

client.Count(10).Offset(10).Sort(srt).ChannelList()

PS

Feel free to create issue for add new endpoint to this client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAllRequest

type AddAllRequest struct {
	RoomId          string `json:"roomId"`
	ActiveUsersOnly bool   `json:"activeUsersOnly,omitempty"`
}

type AddAllResponse

type AddAllResponse struct {
	Channel Channel `json:"channel"`
	Success bool    `json:"success"`
}

type AddGroupPermissionRequest

type AddGroupPermissionRequest struct {
	RoomId string `json:"roomId"`
	UserId string `json:"userId"`
}

type Apps

type Apps struct {
	EngineVersion  string `json:"engineVersion"`
	Enabled        bool   `json:"enabled"`
	TotalInstalled int    `json:"totalInstalled"`
	TotalActive    int    `json:"totalActive"`
}

type AttachField

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

type Attachment

type Attachment struct {
	AudioURL          string        `json:"audio_url,omitempty"`
	AuthorIcon        string        `json:"author_icon,omitempty"`
	AuthorLink        string        `json:"author_link,omitempty"`
	AuthorName        string        `json:"author_name,omitempty"`
	Collapsed         bool          `json:"collapsed,omitempty"`
	Color             string        `json:"color,omitempty"`
	Fields            []AttachField `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"`
	Ts                time.Time     `json:"ts,omitempty"`
	VideoURL          string        `json:"video_url,omitempty"`
}

type Build

type Build struct {
	Date        time.Time `json:"date"`
	NodeVersion string    `json:"nodeVersion"`
	Arch        string    `json:"arch"`
	Platform    string    `json:"platform"`
	OsRelease   string    `json:"osRelease"`
	TotalMemory int64     `json:"totalMemory"`
	FreeMemory  int       `json:"freeMemory"`
	Cpus        int       `json:"cpus"`
}

type Channel

type Channel struct {
	ID        string    `json:"_id"`
	Name      string    `json:"name"`
	T         string    `json:"t"`
	Usernames []string  `json:"usernames"`
	Msgs      int       `json:"msgs"`
	U         U         `json:"u"`
	Ts        time.Time `json:"ts"`
}

type ChannelCountersRequest

type ChannelCountersRequest struct {
	RoomId   string
	RoomName string
	UserId   string
}

type ChannelCountersResponse

type ChannelCountersResponse struct {
	Joined       bool      `json:"joined"`
	Members      int       `json:"members"`
	Unreads      int       `json:"unreads"`
	UnreadsFrom  time.Time `json:"unreadsFrom"`
	Msgs         int       `json:"msgs"`
	Latest       time.Time `json:"latest"`
	UserMentions int       `json:"userMentions"`
	Success      bool      `json:"success"`
}

type ChannelHistoryRequest

type ChannelHistoryRequest struct {
	RoomId    string
	Latest    time.Time
	Oldest    time.Time
	Inclusive bool
	Offset    int
	Count     int
	Unreads   bool
}

type ChannelInfo

type ChannelInfo struct {
	ID           string `json:"_id"`
	Name         string `json:"name"`
	Fname        string `json:"fname"`
	T            string `json:"t"`
	Msgs         int    `json:"msgs"`
	UsersCount   int    `json:"usersCount"`
	U            UChat  `json:"u"`
	CustomFields struct {
	} `json:"customFields"`
	Broadcast bool      `json:"broadcast"`
	Encrypted bool      `json:"encrypted"`
	Ts        time.Time `json:"ts"`
	Ro        bool      `json:"ro"`
	Default   bool      `json:"default"`
	SysMes    bool      `json:"sysMes"`
	UpdatedAt time.Time `json:"_updatedAt"`
}

type ChannelInfoResponse

type ChannelInfoResponse struct {
	Channel ChannelInfo `json:"channel"`
	Success bool        `json:"success"`
}

type ChannelList

type ChannelList struct {
	ID        string    `json:"_id"`
	Name      string    `json:"name"`
	T         string    `json:"t"`
	Usernames []string  `json:"usernames"`
	Msgs      int       `json:"msgs"`
	U         UChat     `json:"u"`
	Ts        time.Time `json:"ts"`
	Ro        bool      `json:"ro"`
	SysMes    bool      `json:"sysMes"`
	UpdatedAt time.Time `json:"_updatedAt"`
}

type ChannelListResponse

type ChannelListResponse struct {
	Channels []ChannelList `json:"channels"`
	Offset   int           `json:"offset"`
	Count    int           `json:"count"`
	Total    int           `json:"total"`
	Success  bool          `json:"success"`
}

type ChannelMembersResponse

type ChannelMembersResponse struct {
	Members []Member `json:"members"`
	Count   int      `json:"count"`
	Offset  int      `json:"offset"`
	Total   int      `json:"total"`
	Success bool     `json:"success"`
}

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string) *Client

NewClient creates new rocket.chat client with given API key

func NewWithOptions

func NewWithOptions(url string, opts ...Option) *Client

NewWithOptions creates new rocket.chat client with options

func (*Client) AddAllToChannel

func (c *Client) AddAllToChannel(params *AddAllRequest) (*AddAllResponse, error)

AddAllToChannel adds all of the users on the server to a channel.

func (*Client) AddLeaderGroup

func (c *Client) AddLeaderGroup(param *AddGroupPermissionRequest) (*SimpleSuccessResponse, error)

AddLeaderGroup adds a leader for the group.

func (*Client) AddOwnerGroup

func (c *Client) AddOwnerGroup(param *AddGroupPermissionRequest) (*SimpleSuccessResponse, error)

AddOwnerGroup adds an owner for the group.

func (*Client) ArchiveChannel

func (c *Client) ArchiveChannel(param *SimpleChannelId) (*SimpleSuccessResponse, error)

ArchiveChannel archives a channel.

func (*Client) ArchiveGroup

func (c *Client) ArchiveGroup(param *SimpleGroupId) (*SimpleSuccessResponse, error)

ArchiveGroup archives a group.

func (*Client) ChannelCounters

func (c *Client) ChannelCounters(param *ChannelCountersRequest) (*ChannelCountersResponse, error)

ChannelCounters gets channel counters.

func (*Client) ChannelInfo

func (c *Client) ChannelInfo(param *SimpleChannelRequest) (*ChannelInfoResponse, error)

ChannelInfo get channel info.

func (*Client) ChannelInvite

func (c *Client) ChannelInvite(param *InviteChannelRequest) (*InviteChannelResponse, error)

ChannelInvite adds a user to the channel.

func (*Client) ChannelKick

func (c *Client) ChannelKick(param *InviteChannelRequest) (*InviteChannelResponse, error)

ChannelKick kick a user from the channel.

func (*Client) ChannelList

func (c *Client) ChannelList() (*ChannelListResponse, error)

ChannelList get channels list

func (*Client) ChannelMembers

func (c *Client) ChannelMembers(param *SimpleChannelRequest) (*ChannelMembersResponse, error)

ChannelMembers gets channel members

func (*Client) CloseChannel

func (c *Client) CloseChannel(param *SimpleChannelId) (*SimpleSuccessResponse, error)

CloseChannel removes the channel from the user's list of channels.

func (*Client) CloseGroup

func (c *Client) CloseGroup(param *SimpleGroupId) (*SimpleSuccessResponse, error)

CloseGroup closes a group.

func (*Client) Count added in v0.1.2

func (c *Client) Count(val int) *Client

func (*Client) CreateChannel

func (c *Client) CreateChannel(param *CreateChannelRequest) (*CreateChannelResponse, error)

CreateChannel creates a new channel.

func (*Client) CreateGroup

func (c *Client) CreateGroup(param *CreateGroupRequest) (*CreateGroupResponse, error)

CreateGroup creates a group.

func (*Client) DeleteChannel

func (c *Client) DeleteChannel(param *SimpleChannelRequest) (*SimpleSuccessResponse, error)

DeleteChannel delete channel.

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(param *SimpleGroupId) (*SimpleSuccessResponse, error)

DeleteGroup deletes a group.

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(param *DeleteMessageRequest) (*DeleteMessageResponse, error)

DeleteMessage deletes an existing chat message.

func (*Client) Directory

func (c *Client) Directory() (*RespDirectory, error)

Directory returns a list of channels

func (*Client) GetMessage

func (c *Client) GetMessage(param *SingleMessageId) (*GetMessageResponse, error)

GetMessage retrieves a single chat message by the provided id. Callee must have permission to access the room where the message resides.

func (*Client) GetPinnedMessages

func (c *Client) GetPinnedMessages(param *GetPinnedMsgRequest) (*GetPinnedMsgResponse, error)

GetPinnedMessages retrieve pinned messages from a room.

func (*Client) GetSupportedLanguage

func (c *Client) GetSupportedLanguage(query string) (*SupportedLanguageResp, error)

GetSupportedLanguage returns a list of supported languages by the autotranslate

func (*Client) GroupCounters

func (c *Client) GroupCounters(param *GroupCountersRequest) (*GroupCountersResponse, error)

GroupCounters gets counters of the group.

func (*Client) GroupInfo

func (c *Client) GroupInfo(param *SimpleGroupRequest) (*GroupInfoResponse, error)

GroupInfo gets group information.

func (*Client) GroupInvite

func (c *Client) GroupInvite(param *InviteGroupRequest) (*InviteGroupResponse, error)

GroupInvite invites a user to the group.

func (*Client) GroupKick

func (c *Client) GroupKick(param *InviteGroupRequest) (*InviteGroupResponse, error)

GroupKick removes a user from the group.

func (*Client) GroupList

func (c *Client) GroupList() (*GroupListResponse, error)

GroupList gets the list of groups the caller is part of.

func (*Client) GroupMembers

func (c *Client) GroupMembers(param *SimpleGroupRequest) (*GroupMembersResponse, error)

GroupMembers gets the list of members of a group.

func (*Client) GroupMessages added in v0.1.3

func (c *Client) GroupMessages(param *SimpleGroupRequest) (*GroupMessagesResponse, error)

GroupMessages gets the messages from a group.

func (*Client) Hooks

func (c *Client) Hooks(msg *HookMessage, token string) (*HookResponse, error)

func (*Client) Info

func (c *Client) Info() (*RespInfo, error)

Info returns information about the server

func (*Client) Login

func (c *Client) Login(login *LoginPayload) (*LoginResponse, error)

Login login the user with the given credentials.

func (*Client) Logout

func (c *Client) Logout() (*LogoutResponse, error)

Logout logout the user.

func (*Client) Me

func (c *Client) Me() (*MeResponse, error)

Me get the user information.

func (*Client) Offset added in v0.1.2

func (c *Client) Offset(val int) *Client

func (*Client) OpenChannel

func (c *Client) OpenChannel(param *SimpleChannelId) (*SimpleSuccessResponse, error)

OpenChannel adds the channel back to the user's list of channels.

func (*Client) OpenGroup

func (c *Client) OpenGroup(param *SimpleGroupId) (*SimpleSuccessResponse, error)

OpenGroup opens a group.

func (*Client) PinMessage

func (c *Client) PinMessage(param *SingleMessageId) (*PinMessageResponse, error)

PinMessage pins a chat message to the message's channel.

func (*Client) PostMessage

func (c *Client) PostMessage(msg *Message) (*RespPostMessage, error)

PostMessage posts a new chat message.

func (*Client) RenameChannel

func (c *Client) RenameChannel(param *RenameChannelRequest) (*RenameChannelResponse, error)

RenameChannel changes a channel's name.

func (*Client) RenameGroup

func (c *Client) RenameGroup(param *RenameGroupRequest) (*RenameGroupResponse, error)

RenameGroup renames a group.

func (*Client) SetAnnouncementChannel

func (c *Client) SetAnnouncementChannel(param *SetAnnouncementRequest) (*SetAnnouncementResponse, error)

SetAnnouncementChannel sets the announcement for the channel.

func (*Client) SetAnnouncementGroup

func (c *Client) SetAnnouncementGroup(param *SetAnnouncementRequest) (*SetAnnouncementResponse, error)

SetAnnouncementGroup sets the announcement for the group.

func (*Client) SetDescriptionChannel

func (c *Client) SetDescriptionChannel(param *SetDescriptionRequest) (*SetDescriptionResponse, error)

SetDescriptionChannel sets the Description for the channel.

func (*Client) SetDescriptionGroup

func (c *Client) SetDescriptionGroup(param *SetDescriptionRequest) (*SetDescriptionResponse, error)

SetDescriptionGroup sets the description for the group.

func (*Client) SetTopicChannel

func (c *Client) SetTopicChannel(param *SetTopicRequest) (*SetTopicResponse, error)

SetTopicChannel sets the topic for the channel.

func (*Client) SetTopicGroup

func (c *Client) SetTopicGroup(param *SetTopicRequest) (*SetTopicResponse, error)

SetTopicGroup sets the topic for the group.

func (*Client) Sort added in v0.1.2

func (c *Client) Sort(val map[string]int) *Client

func (*Client) Spotlight

func (c *Client) Spotlight(query string) (*RespSpotlight, error)

Spotlight returns a list of users and rooms that match the provided query

func (*Client) Statistics

func (c *Client) Statistics() (*RespStatistics, error)

Statistics returns statistics about the server

func (*Client) StatisticsList

func (c *Client) StatisticsList() (*RespStatisticsList, error)

StatisticsList returns a list of statistics

func (*Client) UnarchiveChannel

func (c *Client) UnarchiveChannel(param *SimpleChannelId) (*SimpleSuccessResponse, error)

UnarchiveChannel unarchive a channel.

func (*Client) UnarchiveGroup

func (c *Client) UnarchiveGroup(param *SimpleGroupId) (*SimpleSuccessResponse, error)

UnarchiveGroup unarchives a group.

func (*Client) UnpinMessage

func (c *Client) UnpinMessage(param *SingleMessageId) (*SimpleSuccessResponse, error)

UnpinMessage unpins a chat message to the message's channel.

func (*Client) UsersCreate

func (c *Client) UsersCreate(user *NewUser) (*UserCreateResponse, error)

UsersCreate creates a new user.

func (*Client) UsersCreateToken

func (c *Client) UsersCreateToken(user *SimpleUserRequest) (*CreateTokenResponse, error)

UsersCreateToken creates a user token.

func (*Client) UsersDeactivateIdle

func (c *Client) UsersDeactivateIdle(params *DeactivateRequest) (*DeactivateResponse, error)

UsersDeactivateIdle deactivates idle users.

func (*Client) UsersDelete

func (c *Client) UsersDelete(user *UsersDelete) (*SimpleSuccessResponse, error)

UsersDelete deletes a user.

func (*Client) UsersDeleteOwnAccount

func (c *Client) UsersDeleteOwnAccount(pass string) (*SimpleSuccessResponse, error)

UsersDeleteOwnAccount deletes your own account.

func (*Client) UsersForgotPassword

func (c *Client) UsersForgotPassword(email string) (*SimpleSuccessResponse, error)

UsersForgotPassword send an email to reset your password

func (*Client) UsersGeneratePersonalAccessToken

func (c *Client) UsersGeneratePersonalAccessToken(params *GetNewToken) (*NewTokenResponse, error)

UsersGeneratePersonalAccessToken generates a personal access token

func (*Client) UsersGetStatus

func (c *Client) UsersGetStatus(user *SimpleUserRequest) (*GetStatusResponse, error)

UsersGetStatus gets the status of a user

func (*Client) UsersInfo

func (c *Client) UsersInfo(user *SimpleUserRequest) (*UsersInfoResponse, error)

UsersInfo gets the information of a user

func (*Client) UsersPresence

func (c *Client) UsersPresence(query string) (*UsersPresenceResponse, error)

UsersPresence gets all connected users presence

func (*Client) UsersRegister

func (c *Client) UsersRegister(user *UserRegisterRequest) (*UsersInfoResponse, error)

UsersRegister registers a new user

func (*Client) UsersSetStatus

func (c *Client) UsersSetStatus(status *SetStatus) (*SimpleSuccessResponse, error)

UsersSetStatus sets the status of a user

func (*Client) UsersUpdate

func (c *Client) UsersUpdate(user *UserUpdateRequest) (*UserUpdateResponse, error)

UsersUpdate updates a user

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 Cpus

type Cpus struct {
	Model string `json:"model"`
	Speed int    `json:"speed"`
	Times Times  `json:"times"`
}

type CreateChannelRequest

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

type CreateChannelResponse

type CreateChannelResponse struct {
	Channel Channel `json:"channel"`
	Success bool    `json:"success"`
}

type CreateGroupRequest

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

type CreateGroupResponse

type CreateGroupResponse struct {
	Group   Channel `json:"group"`
	Success bool    `json:"success"`
}

type CreateTokenResponse

type CreateTokenResponse struct {
	Data struct {
		UserID    string `json:"userId"`
		AuthToken string `json:"authToken"`
	} `json:"data"`
	Success bool `json:"success"`
}

type DataLogin

type DataLogin struct {
	UserID    string `json:"userId"`
	AuthToken string `json:"authToken"`
	Me        Me     `json:"me"`
}

type DeactivateRequest

type DeactivateRequest struct {
	DaysIdle string `json:"daysIdle"`
	Role     string `json:"role,omitempty"`
}

type DeactivateResponse

type DeactivateResponse struct {
	Count   int  `json:"count"`
	Success bool `json:"success"`
}

type DeleteMessageRequest

type DeleteMessageRequest struct {
	RoomID string `json:"roomId"`
	MsgID  string `json:"msgId"`
	AsUser bool   `json:"asUser,omitempty"`
}

type DeleteMessageResponse

type DeleteMessageResponse struct {
	ID      string `json:"_id"`
	Ts      int64  `json:"ts"`
	Success bool   `json:"success"`
}

todo add the remaining fields

type Deploy

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

type DirectoryResult added in v0.1.4

type DirectoryResult struct {
	ID         string    `json:"_id"`
	CreatedAt  time.Time `json:"createdAt"`
	Emails     []Email   `json:"emails"`
	Name       string    `json:"name"`
	Username   string    `json:"username"`
	AvatarETag string    `json:"avatarETag"`
}

type DontAskAgainList

type DontAskAgainList struct {
	Action string `json:"action"`
	Label  string `json:"label"`
}

type Email

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

type GetMessageResponse

type GetMessageResponse struct {
	Message MessageResp `json:"message"`
	Success bool        `json:"success"`
}

type GetNewToken

type GetNewToken struct {
	Token     string `json:"tokenName"`
	TwoFactor bool   `json:"bypassTwoFactor,omitempty"`
}

type GetPinnedMsgRequest

type GetPinnedMsgRequest struct {
	RoomId string
	Count  int
	Offset int
}

type GetPinnedMsgResponse

type GetPinnedMsgResponse struct {
	Messages []PinnedMessage `json:"messages"`
	Count    int             `json:"count"`
	Offset   int             `json:"offset"`
	Total    int             `json:"total"`
	Success  bool            `json:"success"`
}

type GetStatusResponse

type GetStatusResponse struct {
	Message          string `json:"message"`
	ConnectionStatus string `json:"connectionStatus"`
	Status           string `json:"status"`
	Success          bool   `json:"success"`
}

type GroupCountersRequest

type GroupCountersRequest struct {
	RoomId   string
	RoomName string
	UserId   string
}

type GroupCountersResponse

type GroupCountersResponse struct {
	Joined       bool      `json:"joined"`
	Members      int       `json:"members"`
	Unreads      int       `json:"unreads"`
	UnreadsFrom  time.Time `json:"unreadsFrom"`
	Msgs         int       `json:"msgs"`
	Latest       time.Time `json:"latest"`
	UserMentions int       `json:"userMentions"`
	Success      bool      `json:"success"`
}

type GroupInfoResponse

type GroupInfoResponse struct {
	Group   groupInfo `json:"group"`
	Success bool      `json:"success"`
}

type GroupListResponse

type GroupListResponse struct {
	Groups  []groupList `json:"groups"`
	Offset  int         `json:"offset"`
	Count   int         `json:"count"`
	Total   int         `json:"total"`
	Success bool        `json:"success"`
}

type GroupMembersResponse

type GroupMembersResponse struct {
	Members []Member `json:"members"`
	Count   int      `json:"count"`
	Offset  int      `json:"offset"`
	Total   int      `json:"total"`
	Success bool     `json:"success"`
}

type GroupMessage added in v0.1.3

type GroupMessage struct {
	ID        string    `json:"_id"`
	Rid       string    `json:"rid"`
	Msg       string    `json:"msg"`
	Ts        time.Time `json:"ts"`
	U         U         `json:"u"`
	UpdatedAt time.Time `json:"_updatedAt"`
}

type GroupMessagesResponse added in v0.1.3

type GroupMessagesResponse struct {
	Messages []GroupMessage `json:"messages"`
	Count    int            `json:"count"`
	Offset   int            `json:"offset"`
	Total    int            `json:"total"`
	Success  bool           `json:"success"`
}

type HandlerHelper added in v0.1.4

type HandlerHelper struct {
	Code         int
	ResponseBody string
}

type HookAttachment

type HookAttachment struct {
	Title     string `json:"title"`
	TitleLink string `json:"title_link"`
	Text      string `json:"text"`
	ImageURL  string `json:"image_url"`
	Color     string `json:"color"`
}

type HookMessage

type HookMessage struct {
	Text        string           `json:"text"`
	Attachments []HookAttachment `json:"attachments"`
}

type HookResponse

type HookResponse struct {
	Success bool `json:"success"`
}

type Integrations

type Integrations struct {
	TotalIntegrations      int `json:"totalIntegrations"`
	TotalIncoming          int `json:"totalIncoming"`
	TotalIncomingActive    int `json:"totalIncomingActive"`
	TotalOutgoing          int `json:"totalOutgoing"`
	TotalOutgoingActive    int `json:"totalOutgoingActive"`
	TotalWithScriptEnabled int `json:"totalWithScriptEnabled"`
}

type InviteChannelRequest

type InviteChannelRequest struct {
	RoomId string `json:"roomId"`
	UserId string `json:"userId"`
}

type InviteChannelResponse

type InviteChannelResponse struct {
	Channel struct {
		ID        string    `json:"_id"`
		Ts        time.Time `json:"ts"`
		T         string    `json:"t"`
		Name      string    `json:"name"`
		Usernames []string  `json:"usernames"`
		Msgs      int       `json:"msgs"`
		UpdatedAt time.Time `json:"_updatedAt"`
		Lm        time.Time `json:"lm"`
	} `json:"channel"`
	Success bool `json:"success"`
}

type InviteGroupRequest

type InviteGroupRequest struct {
	RoomId string `json:"roomId"`
	UserId string `json:"userId"`
}

type InviteGroupResponse

type InviteGroupResponse struct {
	Group struct {
		ID        string    `json:"_id"`
		Ts        time.Time `json:"ts"`
		T         string    `json:"t"`
		Name      string    `json:"name"`
		Usernames []string  `json:"usernames,omitempty"`
		U         UChat     `json:"u"`
		Username  string    `json:"username,omitempty"`
		Msgs      int       `json:"msgs"`
		UpdatedAt time.Time `json:"_updatedAt"`
		Lm        time.Time `json:"lm"`
	} `json:"group"`
	Success bool `json:"success"`
}

type LastMessage

type LastMessage struct {
	ID          string        `json:"_id"`
	Alias       string        `json:"alias"`
	Msg         string        `json:"msg"`
	Attachments []interface{} `json:"attachments"`
	ParseUrls   bool          `json:"parseUrls"`
	Groupable   bool          `json:"groupable"`
	Ts          time.Time     `json:"ts"`
	U           U             `json:"u"`
	Rid         string        `json:"rid"`
	UpdatedAt   time.Time     `json:"_updatedAt"`
	Mentions    []interface{} `json:"mentions"`
	Channels    []interface{} `json:"channels"`
}

type LoginPayload

type LoginPayload struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Resume   string `json:"resume,omitempty"`
}

type LoginResponse

type LoginResponse struct {
	Status  string    `json:"status"`
	Data    DataLogin `json:"data"`
	Message string    `json:"message,omitempty"`
}

type LogoutResponse

type LogoutResponse struct {
	Status string `json:"status"`
	Data   struct {
		Message string `json:"message"`
	} `json:"data"`
}

type Me

type Me struct {
	ID                    string    `json:"_id"`
	Services              Services  `json:"services"`
	Emails                []Email   `json:"emails"`
	Status                string    `json:"status"`
	Active                bool      `json:"active"`
	UpdatedAt             time.Time `json:"_updatedAt"`
	Roles                 []string  `json:"roles"`
	Name                  string    `json:"name"`
	StatusConnection      string    `json:"statusConnection"`
	Username              string    `json:"username"`
	UtcOffset             float64   `json:"utcOffset"`
	StatusText            string    `json:"statusText"`
	Settings              Settings  `json:"settings"`
	AvatarOrigin          string    `json:"avatarOrigin"`
	RequirePasswordChange bool      `json:"requirePasswordChange"`
	Language              string    `json:"language"`
	Email                 string    `json:"email"`
	AvatarURL             string    `json:"avatarUrl"`
}

type MeResponse

type MeResponse struct {
	ID                    string    `json:"_id"`
	Services              Services  `json:"services"`
	Emails                []Email   `json:"emails"`
	Status                string    `json:"status"`
	Active                bool      `json:"active"`
	UpdatedAt             time.Time `json:"_updatedAt"`
	Roles                 []string  `json:"roles"`
	Name                  string    `json:"name"`
	StatusConnection      string    `json:"statusConnection"`
	Username              string    `json:"username"`
	UtcOffset             float64   `json:"utcOffset"`
	StatusText            string    `json:"statusText"`
	Settings              Settings  `json:"settings"`
	AvatarOrigin          string    `json:"avatarOrigin"`
	RequirePasswordChange bool      `json:"requirePasswordChange"`
	Language              string    `json:"language"`
	Email                 string    `json:"email"`
	AvatarURL             string    `json:"avatarUrl"`
	Success               bool      `json:"success"`
}

type Member

type Member struct {
	ID       string `json:"_id"`
	Username string `json:"username"`
	Name     string `json:"name"`
	Status   string `json:"status"`
}

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:"roomId,omitempty"`
	Text        string       `json:"text"`
	Attachments []Attachment `json:"attachments"`
}

type MessageResp

type MessageResp struct {
	ID  string    `json:"_id"`
	Rid string    `json:"rid"`
	Msg string    `json:"msg"`
	Ts  time.Time `json:"ts"`
	U   struct {
		ID       string `json:"_id"`
		Username string `json:"username"`
	} `json:"u"`
}

type Migration

type Migration struct {
	ID      string `json:"_id"`
	Locked  bool   `json:"locked"`
	Version int    `json:"version"`
}

type NewTokenResponse

type NewTokenResponse struct {
	Token   string `json:"token"`
	Success bool   `json:"success"`
}

type NewUser

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

type Option

type Option func(*Client)

func WithTimeout

func WithTimeout(d time.Duration) Option

func WithUserID

func WithUserID(userID string) Option

func WithXToken

func WithXToken(xtoken string) Option

type Os

type 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     []Cpus    `json:"cpus"`
}

type PaginationStruct added in v0.1.2

type PaginationStruct struct {
	Count  int    `url:"count,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Sort   string `url:"sort,omitempty"`
}

type Password

type Password struct {
	Bcrypt string `json:"bcrypt"`
}

type PinMessageResponse

type PinMessageResponse struct {
	Message struct {
		T   string    `json:"t"`
		Rid string    `json:"rid"`
		Ts  time.Time `json:"ts"`
		Msg string    `json:"msg"`
		U   struct {
			ID       string `json:"_id"`
			Username string `json:"username"`
		} `json:"u"`
		Groupable   bool `json:"groupable"`
		Attachments []struct {
			Text       string    `json:"text"`
			AuthorName string    `json:"author_name"`
			AuthorIcon string    `json:"author_icon"`
			Ts         time.Time `json:"ts"`
		} `json:"attachments"`
		UpdatedAt time.Time `json:"_updatedAt"`
		ID        string    `json:"_id"`
	} `json:"message"`
	Success bool `json:"success"`
}

type PinnedMessage

type PinnedMessage struct {
	ID  string    `json:"_id"`
	Rid string    `json:"rid"`
	Msg string    `json:"msg"`
	Ts  time.Time `json:"ts"`
	U   struct {
		ID       string `json:"_id"`
		Username string `json:"username"`
		Name     string `json:"name"`
	} `json:"u"`
	Mentions  []interface{} `json:"mentions"`
	Channels  []interface{} `json:"channels"`
	UpdatedAt time.Time     `json:"_updatedAt"`
	Pinned    bool          `json:"pinned"`
	PinnedAt  time.Time     `json:"pinnedAt"`
	PinnedBy  struct {
		ID       string `json:"_id"`
		Username string `json:"username"`
	} `json:"pinnedBy"`
}

type Preferences

type Preferences struct {
	EnableAutoAway                        bool               `json:"enableAutoAway"`
	IdleTimeLimit                         int                `json:"idleTimeLimit"`
	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"`
	SidebarGroupByType                    bool               `json:"sidebarGroupByType"`
	SidebarViewMode                       string             `json:"sidebarViewMode"`
	SidebarHideAvatar                     bool               `json:"sidebarHideAvatar"`
	SidebarShowUnread                     bool               `json:"sidebarShowUnread"`
	SidebarShowFavorites                  bool               `json:"sidebarShowFavorites"`
	SendOnEnter                           string             `json:"sendOnEnter"`
	MessageViewMode                       int                `json:"messageViewMode"`
	EmailNotificationMode                 string             `json:"emailNotificationMode"`
	NewRoomNotification                   string             `json:"newRoomNotification"`
	NewMessageNotification                string             `json:"newMessageNotification"`
	MuteFocusedConversations              bool               `json:"muteFocusedConversations"`
	NotificationsSoundVolume              int                `json:"notificationsSoundVolume"`
	SidebarShowDiscussion                 bool               `json:"sidebarShowDiscussion"`
	DesktopNotificationRequireInteraction bool               `json:"desktopNotificationRequireInteraction"`
	SidebarSortby                         string             `json:"sidebarSortby"`
	DesktopNotificationDuration           int                `json:"desktopNotificationDuration"`
	DontAskAgainList                      []DontAskAgainList `json:"dontAskAgainList"`
	Highlights                            []interface{}      `json:"highlights"`
	Language                              string             `json:"language"`
}

type Process

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

type RenameChannelRequest

type RenameChannelRequest struct {
	RoomId  string `json:"roomId"`
	NewName string `json:"name"`
}

type RenameChannelResponse

type RenameChannelResponse struct {
	Channel ChannelList `json:"channel"`
	Success bool        `json:"success"`
}

type RenameGroupRequest

type RenameGroupRequest struct {
	RoomId  string `json:"roomId"`
	NewName string `json:"name"`
}

type RenameGroupResponse

type RenameGroupResponse struct {
	Group   groupList `json:"group"`
	Success bool      `json:"success"`
}

type RespDirectory

type RespDirectory struct {
	Result  []DirectoryResult `json:"result"`
	Count   int               `json:"count"`
	Offset  int               `json:"offset"`
	Total   int               `json:"total"`
	Success bool              `json:"success"`
}

type RespInfo

type RespInfo struct {
	Version string `json:"version"`
	Info    struct {
		Version               string `json:"version"`
		Build                 Build  `json:"build"`
		Commit                Commit `json:"commit"`
		MarketplaceAPIVersion string `json:"marketplaceApiVersion"`
	} `json:"info"`
	Success bool `json:"success"`
}

type RespMessageData

type RespMessageData struct {
	Alias     string    `json:"alias,omitempty"`
	Msg       string    `json:"msg,omitempty"`
	ParseUrls bool      `json:"parseUrls,omitempty"`
	Groupable bool      `json:"groupable,omitempty"`
	Ts        time.Time `json:"ts,omitempty"`
	U         UChat     `json:"u,omitempty"`
	Rid       string    `json:"rid,omitempty"`
	UpdatedAt time.Time `json:"_updatedAt,omitempty"`
	ID        string    `json:"_id,omitempty"`
}

type RespPostMessage

type RespPostMessage struct {
	Ts        int64           `json:"ts"`
	Channel   string          `json:"channel"`
	Message   RespMessageData `json:"message"`
	Success   bool            `json:"success"`
	Error     string          `json:"error,omitempty"`
	ErrorType string          `json:"errorType,omitempty"`
}

type RespSpotlight

type RespSpotlight struct {
	Users   []UsersInfo `json:"users"`
	Rooms   []RoomsInfo `json:"rooms"`
	Success bool        `json:"success"`
	Error   string      `json:"error,omitempty"`
}

type RespStatistics

type RespStatistics struct {
	ID                        string       `json:"_id"`
	Wizard                    Wizard       `json:"wizard"`
	UniqueID                  string       `json:"uniqueId"`
	InstalledAt               time.Time    `json:"installedAt"`
	Version                   string       `json:"version"`
	TotalUsers                int          `json:"totalUsers"`
	ActiveUsers               int          `json:"activeUsers"`
	ActiveGuests              int          `json:"activeGuests"`
	NonActiveUsers            int          `json:"nonActiveUsers"`
	AppUsers                  int          `json:"appUsers"`
	OnlineUsers               int          `json:"onlineUsers"`
	AwayUsers                 int          `json:"awayUsers"`
	TotalConnectedUsers       int          `json:"totalConnectedUsers"`
	OfflineUsers              int          `json:"offlineUsers"`
	TotalRooms                int          `json:"totalRooms"`
	TotalChannels             int          `json:"totalChannels"`
	TotalPrivateGroups        int          `json:"totalPrivateGroups"`
	TotalDirect               int          `json:"totalDirect"`
	TotalLivechat             int          `json:"totalLivechat"`
	TotalDiscussions          int          `json:"totalDiscussions"`
	TotalThreads              int          `json:"totalThreads"`
	TotalLivechatVisitors     int          `json:"totalLivechatVisitors"`
	TotalLivechatAgents       int          `json:"totalLivechatAgents"`
	LivechatEnabled           bool         `json:"livechatEnabled"`
	TotalChannelMessages      int          `json:"totalChannelMessages"`
	TotalPrivateGroupMessages int          `json:"totalPrivateGroupMessages"`
	TotalDirectMessages       int          `json:"totalDirectMessages"`
	TotalLivechatMessages     int          `json:"totalLivechatMessages"`
	TotalMessages             int          `json:"totalMessages"`
	FederatedServers          int          `json:"federatedServers"`
	FederatedUsers            int          `json:"federatedUsers"`
	LastLogin                 time.Time    `json:"lastLogin"`
	LastMessageSentAt         time.Time    `json:"lastMessageSentAt"`
	LastSeenSubscription      time.Time    `json:"lastSeenSubscription"`
	Os                        Os           `json:"os"`
	Process                   Process      `json:"process"`
	Deploy                    Deploy       `json:"deploy"`
	EnterpriseReady           bool         `json:"enterpriseReady"`
	UploadsTotal              int          `json:"uploadsTotal"`
	UploadsTotalSize          int          `json:"uploadsTotalSize"`
	Migration                 Migration    `json:"migration"`
	InstanceCount             int          `json:"instanceCount"`
	OplogEnabled              bool         `json:"oplogEnabled"`
	MongoVersion              string       `json:"mongoVersion"`
	MongoStorageEngine        string       `json:"mongoStorageEngine"`
	UniqueUsersOfYesterday    Stats        `json:"uniqueUsersOfYesterday"`
	UniqueUsersOfLastMonth    Stats        `json:"uniqueUsersOfLastMonth"`
	UniqueDevicesOfYesterday  Stats        `json:"uniqueDevicesOfYesterday"`
	UniqueDevicesOfLastMonth  Stats        `json:"uniqueDevicesOfLastMonth"`
	UniqueOSOfYesterday       Stats        `json:"uniqueOSOfYesterday"`
	UniqueOSOfLastMonth       Stats        `json:"uniqueOSOfLastMonth"`
	Apps                      Apps         `json:"apps"`
	Integrations              Integrations `json:"integrations"`
	PushQueue                 int          `json:"pushQueue"`
	CreatedAt                 time.Time    `json:"createdAt"`
	UpdatedAt                 time.Time    `json:"_updatedAt"`
	Success                   bool         `json:"success"`
}

type RespStatisticsList

type RespStatisticsList struct {
	Statistics []struct {
		ID                        string       `json:"_id"`
		Wizard                    Wizard       `json:"wizard"`
		UniqueID                  string       `json:"uniqueId"`
		InstalledAt               time.Time    `json:"installedAt"`
		Version                   string       `json:"version"`
		TotalUsers                int          `json:"totalUsers"`
		ActiveUsers               int          `json:"activeUsers"`
		ActiveGuests              int          `json:"activeGuests"`
		NonActiveUsers            int          `json:"nonActiveUsers"`
		AppUsers                  int          `json:"appUsers"`
		OnlineUsers               int          `json:"onlineUsers"`
		AwayUsers                 int          `json:"awayUsers"`
		TotalConnectedUsers       int          `json:"totalConnectedUsers"`
		OfflineUsers              int          `json:"offlineUsers"`
		TotalRooms                int          `json:"totalRooms"`
		TotalChannels             int          `json:"totalChannels"`
		TotalPrivateGroups        int          `json:"totalPrivateGroups"`
		TotalDirect               int          `json:"totalDirect"`
		TotalLivechat             int          `json:"totalLivechat"`
		TotalDiscussions          int          `json:"totalDiscussions"`
		TotalThreads              int          `json:"totalThreads"`
		TotalLivechatVisitors     int          `json:"totalLivechatVisitors"`
		TotalLivechatAgents       int          `json:"totalLivechatAgents"`
		TotalChannelMessages      int          `json:"totalChannelMessages"`
		TotalPrivateGroupMessages int          `json:"totalPrivateGroupMessages"`
		TotalDirectMessages       int          `json:"totalDirectMessages"`
		TotalLivechatMessages     int          `json:"totalLivechatMessages"`
		TotalMessages             int          `json:"totalMessages"`
		FederatedServers          int          `json:"federatedServers"`
		FederatedUsers            int          `json:"federatedUsers"`
		Os                        Os           `json:"os"`
		Process                   Process      `json:"process"`
		Deploy                    Deploy       `json:"deploy"`
		EnterpriseReady           bool         `json:"enterpriseReady"`
		UploadsTotal              int          `json:"uploadsTotal"`
		UploadsTotalSize          int          `json:"uploadsTotalSize"`
		Migration                 Migration    `json:"migration"`
		InstanceCount             int          `json:"instanceCount"`
		OplogEnabled              bool         `json:"oplogEnabled"`
		MongoVersion              string       `json:"mongoVersion"`
		MongoStorageEngine        string       `json:"mongoStorageEngine"`
		UniqueUsersOfYesterday    Stats        `json:"uniqueUsersOfYesterday"`
		UniqueUsersOfLastMonth    Stats        `json:"uniqueUsersOfLastMonth"`
		UniqueDevicesOfYesterday  Stats        `json:"uniqueDevicesOfYesterday"`
		UniqueDevicesOfLastMonth  Stats        `json:"uniqueDevicesOfLastMonth"`
		UniqueOSOfYesterday       Stats        `json:"uniqueOSOfYesterday"`
		UniqueOSOfLastMonth       Stats        `json:"uniqueOSOfLastMonth"`
		Apps                      Apps         `json:"apps"`
		Integrations              Integrations `json:"integrations"`
		PushQueue                 int          `json:"pushQueue"`
		CreatedAt                 time.Time    `json:"createdAt"`
		UpdatedAt                 time.Time    `json:"_updatedAt"`
		LivechatEnabled           bool         `json:"livechatEnabled,omitempty"`
		LastLogin                 time.Time    `json:"lastLogin,omitempty"`
		LastMessageSentAt         time.Time    `json:"lastMessageSentAt,omitempty"`
		LastSeenSubscription      time.Time    `json:"lastSeenSubscription,omitempty"`
	} `json:"statistics"`
	Count   int  `json:"count"`
	Offset  int  `json:"offset"`
	Total   int  `json:"total"`
	Success bool `json:"success"`
}

type Result

type Result struct {
	ID          string      `json:"_id"`
	Ts          time.Time   `json:"ts"`
	T           string      `json:"t"`
	Name        string      `json:"name"`
	UsersCount  int         `json:"usersCount"`
	Default     bool        `json:"default"`
	LastMessage LastMessage `json:"lastMessage"`
}

type RoomsInfo

type RoomsInfo struct {
	ID          string      `json:"_id"`
	Name        string      `json:"name"`
	T           string      `json:"t"`
	LastMessage LastMessage `json:"lastMessage"`
}

type Services

type Services struct {
	Password Password `json:"password"`
}

type SetAnnouncementRequest

type SetAnnouncementRequest struct {
	RoomId       string `json:"roomId"`
	Announcement string `json:"announcement"`
}

type SetAnnouncementResponse

type SetAnnouncementResponse struct {
	Announcement string `json:"announcement"`
	Success      bool   `json:"success"`
}

type SetDescriptionRequest

type SetDescriptionRequest struct {
	RoomId      string `json:"roomId"`
	Description string `json:"description"`
}

type SetDescriptionResponse

type SetDescriptionResponse struct {
	Description string `json:"description"`
	Success     bool   `json:"success"`
}

type SetStatus

type SetStatus struct {
	Message string `json:"message"`
	Status  string `json:"status,omitempty"`
}

type SetTopicRequest

type SetTopicRequest struct {
	RoomId string `json:"roomId"`
	Topic  string `json:"topic"`
}

type SetTopicResponse

type SetTopicResponse struct {
	Topic   string `json:"topic"`
	Success bool   `json:"success"`
}

type Settings

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

type SimpleChannelId

type SimpleChannelId struct {
	RoomId string `json:"roomId,omitempty"`
}

type SimpleChannelRequest

type SimpleChannelRequest struct {
	RoomId   string `json:"roomId,omitempty"`
	RoomName string `json:"roomName,omitempty"`
}

type SimpleGroupId

type SimpleGroupId struct {
	RoomId string `json:"roomId,omitempty"`
}

type SimpleGroupRequest

type SimpleGroupRequest struct {
	RoomId   string `json:"roomId,omitempty"`
	RoomName string `json:"roomName,omitempty"`
}

type SimpleSuccessResponse

type SimpleSuccessResponse struct {
	Success bool `json:"success"`
}

type SimpleUserRequest

type SimpleUserRequest struct {
	UserId   string `json:"userId,omitempty"`
	Username string `json:"username,omitempty"`
}

type SingleMessageId

type SingleMessageId struct {
	MessageId string `json:"messageId"`
}

type SingleUserInfo added in v0.1.4

type SingleUserInfo struct {
	ID         string    `json:"_id"`
	CreatedAt  time.Time `json:"createdAt"`
	Type       string    `json:"type"`
	Status     string    `json:"status"`
	Active     bool      `json:"active"`
	Name       string    `json:"name"`
	UtcOffset  float64   `json:"utcOffset"`
	Username   string    `json:"username"`
	AvatarETag string    `json:"avatarETag,omitempty"`
}

type Stats

type Stats struct {
	Year  int           `json:"year"`
	Month int           `json:"month"`
	Day   int           `json:"day"`
	Data  []interface{} `json:"data"`
}

type SupportedLanguageResp

type SupportedLanguageResp struct {
	Languages []language `json:"languages"`
	Success   bool       `json:"success"`
}

type Times

type Times struct {
	User int `json:"user"`
	Nice int `json:"nice"`
	Sys  int `json:"sys"`
	Idle int `json:"idle"`
	Irq  int `json:"irq"`
}

type U

type U struct {
	ID       string `json:"_id"`
	Username string `json:"username"`
	Name     string `json:"name,omitempty"`
}

type UChat

type UChat struct {
	ID       string `json:"_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type UserCreateResponse

type UserCreateResponse struct {
	User    userCreateInfo `json:"user"`
	Success bool           `json:"success"`
}

type UserRegisterRequest

type UserRegisterRequest struct {
	Username  string `json:"username"`
	Email     string `json:"email"`
	Pass      string `json:"pass"`
	Name      string `json:"name"`
	SecretURL string `json:"secret_url,omitempty"`
}

type UserUpdateData

type UserUpdateData struct {
	Email                 string   `json:"email,omitempty"`
	Name                  string   `json:"name,omitempty"`
	Password              string   `json:"password,omitempty"`
	Username              string   `json:"username,omitempty"`
	Active                bool     `json:"active,omitempty"`
	Roles                 []string `json:"roles,omitempty"`
	RequirePasswordChange bool     `json:"requirePasswordChange,omitempty"`
	SendWelcomeEmail      bool     `json:"sendWelcomeEmail,omitempty"`
	Verified              bool     `json:"verified,omitempty"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	UserId string         `json:"userId"`
	Data   UserUpdateData `json:"data,omitempty"`
}

type UserUpdateResponse

type UserUpdateResponse struct {
	User    userUpdateInfo `json:"user"`
	Success bool           `json:"success"`
}

type UsersDelete

type UsersDelete struct {
	Username string `json:"username"`
}

type UsersInfo

type UsersInfo struct {
	ID         string `json:"_id"`
	Status     string `json:"status"`
	Name       string `json:"name"`
	Username   string `json:"username"`
	StatusText string `json:"statusText"`
	AvatarETag string `json:"avatarETag,omitempty"`
}

type UsersInfoResponse

type UsersInfoResponse struct {
	User    SingleUserInfo `json:"user"`
	Success bool           `json:"success"`
}

type UsersPresenceResponse

type UsersPresenceResponse struct {
	Users   []user `json:"users"`
	Full    bool   `json:"full"`
	Success bool   `json:"success"`
}

type Wizard

type Wizard struct {
	OrganizationType string `json:"organizationType"`
	Industry         string `json:"industry"`
	Size             string `json:"size"`
	Country          string `json:"country"`
	Language         string `json:"language"`
	ServerType       string `json:"serverType"`
	RegisterServer   bool   `json:"registerServer"`
}

Jump to

Keyboard shortcuts

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