Documentation
¶
Index ¶
- type Activities
- type Activity
- type ActivityHandler
- type Actor
- type Client
- func (c *Client) GetMessageContent(activity *Activity) (string, error)
- func (c *Client) InitializeFromMercuryEvent(event *mercury.Event) (*Activity, error)
- func (c *Client) Off(verb string, handler ActivityHandler)
- func (c *Client) On(verb string, handler ActivityHandler)
- func (c *Client) ProcessActivityEvent(event *mercury.Event) (*Activity, error)
- func (c *Client) SetMercuryClient(mercuryClient *mercury.Client)
- type Config
- type MessageType
- type Object
- type Participants
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activities ¶
type Activities struct {
Items []interface{} `json:"items,omitempty"`
}
Activities represents the activities in a conversation
type Activity ¶
type Activity struct {
ID string `json:"id,omitempty"`
ObjectType string `json:"objectType,omitempty"`
URL string `json:"url,omitempty"`
Published string `json:"published,omitempty"`
Verb string `json:"verb,omitempty"`
Actor *Actor `json:"actor,omitempty"`
Object map[string]interface{} `json:"object,omitempty"`
Target *Target `json:"target,omitempty"`
ClientTempID string `json:"clientTempId,omitempty"`
// Additional fields that might be in the data
EncryptionKeyURL string `json:"encryptionKeyUrl,omitempty"`
// Parsed content after decryption (if applicable)
Content string `json:"-"`
DecryptedObject *Object `json:"-"`
MessageType MessageType `json:"-"`
// Raw data for debugging
RawData map[string]interface{} `json:"-"`
}
Activity represents a conversation activity
type ActivityHandler ¶
type ActivityHandler func(activity *Activity)
ActivityHandler is a function that handles conversation activities
type Actor ¶
type Actor struct {
ID string `json:"id,omitempty"`
ObjectType string `json:"objectType,omitempty"`
DisplayName string `json:"displayName,omitempty"`
OrgID string `json:"orgId,omitempty"`
EmailAddress string `json:"emailAddress,omitempty"`
EntryUUID string `json:"entryUUID,omitempty"`
Type string `json:"type,omitempty"`
}
Actor represents the person who performed the activity
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Conversation API client
func (*Client) GetMessageContent ¶
GetMessageContent attempts to extract the message content from an activity TODO: Implement message decryption
func (*Client) InitializeFromMercuryEvent ¶
InitializeFromMercuryEvent initializes an activity from a Mercury event
func (*Client) Off ¶
func (c *Client) Off(verb string, handler ActivityHandler)
Off removes a handler for a specific activity verb
func (*Client) On ¶
func (c *Client) On(verb string, handler ActivityHandler)
On registers a handler for a specific activity verb
func (*Client) ProcessActivityEvent ¶
ProcessActivityEvent processes a conversation activity event from Mercury
func (*Client) SetMercuryClient ¶
SetMercuryClient sets the Mercury client to use for WebSocket events
type Config ¶
type Config struct {
}
Config holds the configuration for the Conversation plugin
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for the Conversation plugin
type MessageType ¶
type MessageType string
MessageType represents the type of message
const ( // MessageTypePost represents a post message MessageTypePost MessageType = "post" MessageTypeShare MessageType = "share" // MessageTypeAcknowledge represents an acknowledge message MessageTypeAcknowledge MessageType = "acknowledge" // WildcardHandler is used for handling all activity types WildcardHandler = "*" )
type Object ¶
type Object struct {
ObjectType string `json:"objectType,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Content string `json:"content,omitempty"`
ContentType string `json:"contentType,omitempty"`
// For reference to another activity (used in acknowledge)
ID string `json:"id,omitempty"`
URL string `json:"url,omitempty"`
Published string `json:"published,omitempty"`
}
Object represents the content of a message
type Participants ¶
type Participants struct {
Items []interface{} `json:"items,omitempty"`
}
Participants represents the participants in a conversation
type Target ¶
type Target struct {
ID string `json:"id,omitempty"`
ObjectType string `json:"objectType,omitempty"`
URL string `json:"url,omitempty"`
Published string `json:"published,omitempty"`
Participants *Participants `json:"participants,omitempty"`
Activities *Activities `json:"activities,omitempty"`
Tags []string `json:"tags,omitempty"`
GlobalID string `json:"globalId,omitempty"`
}
Target represents the conversation where the activity occurred