Documentation ¶
Overview ¶
See https://github.com/ninchat/ninchat-go/blob/master/webhook/example/processor.go for an example.
Index ¶
- Constants
- type Audience
- type AudienceAccepted
- type AudienceComplete
- type AudienceCompleteResponse
- type AudienceMember
- type AudienceRequested
- type ChannelInfoPayload
- type DataAccess
- type DataAccessResponse
- type EventType
- type File
- type FilePayload
- type JoinInfoPayload
- type MemberInfoPayload
- type Message
- func (m *Message) ChannelInfoPayload() (p ChannelInfoPayload, err error)
- func (m *Message) FilePayload() (p FilePayload, err error)
- func (m *Message) JoinInfoPayload() (p JoinInfoPayload, err error)
- func (m *Message) MemberInfoPayload() (p MemberInfoPayload, err error)
- func (m *Message) MetadataPayload() (p MetadataPayload, err error)
- func (m *Message) NoticePayload() (p NoticePayload, err error)
- func (m *Message) PartInfoPayload() (p PartInfoPayload, err error)
- func (m *Message) TextPayload() (p TextPayload, err error)
- func (m *Message) UIActionPayload() (p UIActionPayload, err error)
- func (m *Message) UIComposePayload() (p UIComposePayload, err error)
- func (m *Message) UserInfoPayload() (p UserInfoPayload, err error)
- type MessageType
- type MessagesQuery
- type Metadata
- type MetadataPayload
- type NoticePayload
- type PartInfoPayload
- type Query
- type TextPayload
- type UIActionPayload
- type UICompose
- type UIComposePayload
- type UserInfoPayload
- type Webhook
- func (doc *Webhook) AudienceAccepted() (event AudienceAccepted, err error)
- func (doc *Webhook) AudienceComplete() (event AudienceComplete, err error)
- func (doc *Webhook) AudienceRequested() (event AudienceRequested, err error)
- func (doc *Webhook) DataAccess() (event DataAccess, err error)
- func (doc *Webhook) WebhookVerificationResponse() (content []byte)
- type WebhookVerificationResponse
Constants ¶
View Source
const ( MetadataNinchat = "ninchat" MetadataRating = "rating" MetadataSecure = "secure" MetadataTagIDs = "tag_ids" MetadataVars = "vars" )
Well-known metadata keys.
View Source
const AudNinchat = "https://ninchat.com"
View Source
const (
SecureMetadataIdentifier = "identifier"
)
Well-known secure metadata keys.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audience ¶
type Audience struct { RequestTime float64 `json:"request_time,omitempty"` // Always present in event; never in response. AcceptTime float64 `json:"accept_time,omitempty"` FinishTime float64 `json:"finish_time,omitempty"` CompleteTime float64 `json:"complete_time,omitempty"` Members map[string]AudienceMember `json:"members,omitempty"` // Always present in event; never in response. Metadata Metadata `json:"metadata"` }
type AudienceAccepted ¶
type AudienceComplete ¶
type AudienceComplete struct { RealmID string `json:"realm_id"` QueueID string `json:"queue_id"` AudienceID string `json:"audience_id"` Audience Audience `json:"audience"` DialogueID []string `json:"dialogue_id,omitempty"` ChannelID string `json:"channel_id,omitempty"` MemberMessageMetadata map[string]Metadata `json:"member_message_metadata"` Messages []Message `json:"messages,omitempty"` }
type AudienceCompleteResponse ¶ added in v1.3.0
type AudienceCompleteResponse struct {
TranscriptDeleteTime int64 `json:"transcript_delete_time,omitempty"`
}
type AudienceMember ¶
type AudienceRequested ¶ added in v1.3.0
type ChannelInfoPayload ¶
type ChannelInfoPayload struct { ChannelAttrsOldJSON map[string]json.RawMessage `json:"channel_attrs_old"` ChannelAttrsNewJSON map[string]json.RawMessage `json:"channel_attrs_new"` }
type DataAccess ¶ added in v1.3.0
type DataAccessResponse ¶ added in v1.3.0
type File ¶
type File struct { FileID string `json:"file_id"` FileAttrsJSON map[string]json.RawMessage `json:"file_attrs"` }
type FilePayload ¶
type JoinInfoPayload ¶
type MemberInfoPayload ¶
type Message ¶
type Message struct { ID string `json:"id"` Time float64 `json:"time,omitempty"` // Always present in event, may be omitted in response. Type MessageType `json:"type,omitempty"` // Always present in event, may be omitted in response. UserID string `json:"user_id,omitempty"` UserName *string `json:"user_name,omitempty"` Fold bool `json:"fold,omitempty"` PayloadJSON json.RawMessage `json:"payload"` }
func (*Message) ChannelInfoPayload ¶
func (m *Message) ChannelInfoPayload() (p ChannelInfoPayload, err error)
func (*Message) FilePayload ¶
func (m *Message) FilePayload() (p FilePayload, err error)
func (*Message) JoinInfoPayload ¶
func (m *Message) JoinInfoPayload() (p JoinInfoPayload, err error)
func (*Message) MemberInfoPayload ¶
func (m *Message) MemberInfoPayload() (p MemberInfoPayload, err error)
func (*Message) MetadataPayload ¶
func (m *Message) MetadataPayload() (p MetadataPayload, err error)
func (*Message) NoticePayload ¶
func (m *Message) NoticePayload() (p NoticePayload, err error)
func (*Message) PartInfoPayload ¶
func (m *Message) PartInfoPayload() (p PartInfoPayload, err error)
func (*Message) TextPayload ¶
func (m *Message) TextPayload() (p TextPayload, err error)
func (*Message) UIActionPayload ¶
func (m *Message) UIActionPayload() (p UIActionPayload, err error)
func (*Message) UIComposePayload ¶
func (m *Message) UIComposePayload() (p UIComposePayload, err error)
func (*Message) UserInfoPayload ¶
func (m *Message) UserInfoPayload() (p UserInfoPayload, err error)
type MessageType ¶
type MessageType string
const ( MessageFile MessageType = "ninchat.com/file" MessageChannelInfo MessageType = "ninchat.com/info/channel" MessageJoinInfo MessageType = "ninchat.com/info/join" MessageMemberInfo MessageType = "ninchat.com/info/member" MessagePartInfo MessageType = "ninchat.com/info/part" MessageUserInfo MessageType = "ninchat.com/info/user" MessageMetadata MessageType = "ninchat.com/metadata" MessageNotice MessageType = "ninchat.com/notice" MessageText MessageType = "ninchat.com/text" MessageUIAction MessageType = "ninchat.com/ui/action" MessageUICompose MessageType = "ninchat.com/ui/compose" )
type MessagesQuery ¶ added in v1.3.0
type Metadata ¶
type Metadata map[string]json.RawMessage
type MetadataPayload ¶
type NoticePayload ¶
type NoticePayload struct {
TextPayload
}
type PartInfoPayload ¶
type Query ¶ added in v1.3.0
type Query struct { AudienceMetadata bool `json:"audience.metadata,omitempty"` MemberMessageMetadata bool `json:"member_message_metadata,omitempty"` Messages *MessagesQuery `json:"messages,omitempty"` }
type TextPayload ¶
type TextPayload struct {
Text string `json:"text"`
}
type UIActionPayload ¶
type UIComposePayload ¶
type UIComposePayload []UICompose
type UserInfoPayload ¶
type Webhook ¶
type Webhook struct { // Kid and Exp are specified only for transports which use signatures // (i.e. they are specified for HTTP, but not for AWS Lambda functions). Kid string `json:"kid,omitempty"` Exp int64 `json:"exp,omitempty"` Aud string `json:"aud"` Event EventType `json:"event"` EventID string `json:"event_id"` // Raw JSON event fields can be used to store the data in lossless form. WebhookVerificationJSON json.RawMessage `json:"webhook_verification,omitempty"` AudienceRequestedJSON json.RawMessage `json:"audience_requested,omitempty"` AudienceAcceptedJSON json.RawMessage `json:"audience_accepted,omitempty"` AudienceCompleteJSON json.RawMessage `json:"audience_complete,omitempty"` DataAccessJSON json.RawMessage `json:"data_access,omitempty"` }
func (*Webhook) AudienceAccepted ¶
func (doc *Webhook) AudienceAccepted() (event AudienceAccepted, err error)
func (*Webhook) AudienceComplete ¶
func (doc *Webhook) AudienceComplete() (event AudienceComplete, err error)
func (*Webhook) AudienceRequested ¶ added in v1.3.0
func (doc *Webhook) AudienceRequested() (event AudienceRequested, err error)
func (*Webhook) DataAccess ¶ added in v1.3.0
func (doc *Webhook) DataAccess() (event DataAccess, err error)
func (*Webhook) WebhookVerificationResponse ¶ added in v1.3.0
type WebhookVerificationResponse ¶ added in v1.3.0
type WebhookVerificationResponse struct { Aud string `json:"aud"` WebhookVerificationJSON json.RawMessage `json:"webhook_verification"` }
Click to show internal directories.
Click to hide internal directories.