rocketchat

package
v0.0.0-...-5161f07 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Color string `json:"color,omitempty"`

	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"`
	Text      string `json:"text"`

	ImageURL string `json:"image_url,omitempty"`
	ThumbURL string `json:"thumb_url,omitempty"`

	TimeStamp int64 `json:"ts,omitempty"`

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

Attachment -> https://rocket.chat/docs/developer-guides/rest-api/chat/sendmessage/#attachments-detail

type AttachmentField

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

AttachmentField -> https://rocket.chat/docs/developer-guides/rest-api/chat/sendmessage/#attachment-field-objects

type ChatPinMessageAPIRequest

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

ChatPinMessageAPIRequest -> https://rocket.chat/docs/developer-guides/rest-api/chat/pinmessage/#payload

type ChatPostMessageAPIRequest

type ChatPostMessageAPIRequest struct {
	Text        string        `json:"text,omitempty"`
	Channel     string        `json:"channel,omitempty"`
	Username    string        `json:"alias,omitempty"`
	IconUrl     string        `json:"avatar,omitempty"`
	IconEmoji   string        `json:"emoji,omitempty"`
	Attachments []*Attachment `json:"attachments,omitempty"`
}

ChatPostMessageAPIRequest -> https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/#payload

type ChatPostMessageAPIResult

type ChatPostMessageAPIResult struct {
	Success bool
}

ChatPostMessageAPIResult ..

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

LoginRequest -> https://rocket.chat/docs/developer-guides/rest-api/authentication/login/#payload

type LoginResponse

type LoginResponse struct {
	Status string             `json:"status"`
	Data   LoginTokenResponse `json:"data"`
}

LoginResponse -> https://rocket.chat/docs/developer-guides/rest-api/authentication/login/#result

type LoginTokenResponse

type LoginTokenResponse struct {
	UserID    string `json:"userId"`
	AuthToken string `json:"authToken"`
}

LoginTokenResponse -> https://rocket.chat/docs/developer-guides/rest-api/authentication/login/#result

type RocketChat

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

RocketChat Client

func New

func New(urlAPI string, userID string, authToken string) *RocketChat

New cria uma api RocketChat

func (*RocketChat) Login

func (rc *RocketChat) Login(payload *LoginRequest) error

Login -> Authenticate with the REST API. [/api/v1/login] https://rocket.chat/docs/developer-guides/rest-api/authentication/login/

func (*RocketChat) PinMessage

func (rc *RocketChat) PinMessage(payload *ChatPinMessageAPIRequest) error

PinMessage -> Pins a chat message to the message’s channel. [/api/v1/chat.pinMessage] Payload: https://rocket.chat/docs/developer-guides/rest-api/chat/pinmessage/#payload

func (*RocketChat) PostMessage

func (rc *RocketChat) PostMessage(payload *ChatPostMessageAPIRequest) error

PostMessage -> Posts a new chat message. [/api/v1/chat.postMessage] Payload: https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/#payload

func (*RocketChat) PostRequest

func (rc *RocketChat) PostRequest(endpoint string, payload interface{}) ([]byte, error)

PostRequest Low level post request

Jump to

Keyboard shortcuts

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