Documentation
¶
Index ¶
- type Attachment
- type Client
- func (c *Client) Create(message *Message) (*Message, error)
- func (c *Client) Delete(messageID string) error
- func (c *Client) Get(messageID string) (*Message, error)
- func (c *Client) List(options *ListOptions) (*MessagesPage, error)
- func (c *Client) Listen(handler MessageHandler) error
- func (c *Client) StopListening() error
- func (c *Client) Update(messageID string, message *Message) (*Message, error)
- type Config
- type ListOptions
- type Message
- type MessageHandler
- type MessagesPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
ContentType string `json:"contentType,omitempty"`
Content interface{} `json:"content,omitempty"`
}
Attachment represents a message attachment, such as an adaptive card
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the messages API client
func (*Client) List ¶
func (c *Client) List(options *ListOptions) (*MessagesPage, error)
List returns a list of messages in a room
func (*Client) Listen ¶
func (c *Client) Listen(handler MessageHandler) error
Listen starts a real-time stream of message events The provided handler will be called for each new message event
func (*Client) StopListening ¶
StopListening stops the real-time stream of message events
type Config ¶
type Config struct {
// Any configuration settings for the messages plugin can go here
MercuryConfig *mercury.Config
}
Config holds the configuration for the Messages plugin
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for the Messages plugin
type ListOptions ¶
type ListOptions struct {
RoomID string `url:"roomId,omitempty"`
MentionedPeople string `url:"mentionedPeople,omitempty"`
Before string `url:"before,omitempty"`
BeforeMessage string `url:"beforeMessage,omitempty"`
Max int `url:"max,omitempty"`
ThreadID string `url:"threadId,omitempty"`
}
ListOptions contains the options for listing messages
type Message ¶
type Message struct {
ID string `json:"id,omitempty"`
RoomID string `json:"roomId,omitempty"`
ParentID string `json:"parentId,omitempty"`
ToPersonID string `json:"toPersonId,omitempty"`
ToPersonEmail string `json:"toPersonEmail,omitempty"`
Text string `json:"text,omitempty"`
Markdown string `json:"markdown,omitempty"`
HTML string `json:"html,omitempty"`
Files []string `json:"files,omitempty"`
PersonID string `json:"personId,omitempty"`
PersonEmail string `json:"personEmail,omitempty"`
Created *time.Time `json:"created,omitempty"`
Updated *time.Time `json:"updated,omitempty"`
MentionedPeople []string `json:"mentionedPeople,omitempty"`
MentionedGroups []string `json:"mentionedGroups,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
}
Message represents a Webex message
type MessageHandler ¶
type MessageHandler func(message *Message)
MessageHandler is a function that handles a message event
type MessagesPage ¶
MessagesPage represents a paginated list of messages