Documentation ¶
Index ¶
- type Event
- type FormInfo
- type FulfillmentInfo
- type FulfillmentResponse
- type Icon
- type IntentInfo
- type Message
- type Messages
- type OutputAudioText
- type OutputAudioTextMessage
- type PageInfo
- type ParameterInfo
- type PayloadMessage
- type RichContent
- type RichContents
- type RichContentsMessage
- type SessionInfo
- type Source
- type Text
- type TextMessage
- type WebhookRequest
- type WebhookRequests
- type WebhookResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormInfo ¶
type FormInfo struct {
ParameterInfo []ParameterInfo `json:"parameterInfo,omitempty"`
}
FormInfo has been added 2022-03-15
type FulfillmentInfo ¶
type FulfillmentInfo struct {
Tag string `json:"tag,omitempty"`
}
type FulfillmentResponse ¶
type FulfillmentResponse struct { // https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1#ResponseMessage Messages []Message `json:"messages,omitempty"` MergeBehavior int }
func (*FulfillmentResponse) AddMessage ¶
func (fr *FulfillmentResponse) AddMessage(m Message)
type IntentInfo ¶
type OutputAudioText ¶
type OutputAudioTextMessage ¶
type OutputAudioTextMessage struct {
OutputAudioText OutputAudioText `json:"outputAudioText,omitempty"`
}
type ParameterInfo ¶
type PayloadMessage ¶
type PayloadMessage struct {
Payload map[string]interface{} `json:"payload,omitempty"`
}
Rethink - may not work.
type RichContent ¶
type RichContents ¶
type RichContents struct {
RichContent [][]*RichContent `json:"richContent"`
}
func (*RichContents) AddContents ¶
func (cs *RichContents) AddContents(c *RichContent)
type RichContentsMessage ¶
type RichContentsMessage struct {
Payload *RichContents `json:"payload"`
}
func NewRichContentsMessage ¶
func NewRichContentsMessage(c *RichContent) *RichContentsMessage
type SessionInfo ¶
type SessionInfo struct { Session string `json:"session,omitempty"` Parameters map[string]interface{} `json:"parameters,omitempty"` }
func (*SessionInfo) ExtractSession ¶
func (si *SessionInfo) ExtractSession() (string, error)
type WebhookRequest ¶
type WebhookRequest struct { DetectIntentResponseID string `json:"detectIntentResponseId,omitempty"` IntentInfo IntentInfo `json:"intentInfo,omitempty"` PageInfo PageInfo `json:"pageInfo,omitempty"` SessionInfo SessionInfo `json:"sessionInfo,omitempty"` FulfillmentInfo FulfillmentInfo `json:"fulfillmentInfo,omitempty"` Messages []Messages `json:"messages,omitempty"` Payload map[string]interface{} `json:"payload,omitempty"` Text string `json:"text,omitempty"` LanguageCode string `json:"languageCode,omitempty"` }
Structs are fun ()
func FromReader ¶
func FromReader(r io.Reader) (*WebhookRequest, error)
func FromRequest ¶
func FromRequest(r *http.Request) (*WebhookRequest, error)
func (*WebhookRequest) FromReader ¶
func (wr *WebhookRequest) FromReader(r io.Reader) error
func (*WebhookRequest) FromRequest ¶
func (wr *WebhookRequest) FromRequest(r *http.Request) error
type WebhookRequests ¶
type WebhookRequests []*WebhookRequest
Added to make testing easier.
func (*WebhookRequests) UnmarshalJSONReader ¶
func (wrs *WebhookRequests) UnmarshalJSONReader(r io.Reader) error
func (*WebhookRequests) UnmarshalJSONToReaders ¶
Returns Readers to supply as Request Bodies for testing purposes.
type WebhookResponse ¶
type WebhookResponse struct { FulfillmentResponse *FulfillmentResponse `json:"fulfillmentResponse,omitempty"` PageInfo *PageInfo `json:"pageInfo,omitempty"` SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` Payload map[string]string `json:"payload,omitempty"` }
func (*WebhookResponse) AddMessage ¶
func (r *WebhookResponse) AddMessage(m Message) *WebhookResponse
func (*WebhookResponse) Respond ¶
func (r *WebhookResponse) Respond(w http.ResponseWriter) error
func (*WebhookResponse) SSMLResponse ¶
func (wr *WebhookResponse) SSMLResponse(w http.ResponseWriter, msg string)
func (*WebhookResponse) TextResponse ¶
func (wr *WebhookResponse) TextResponse(w http.ResponseWriter, msgs ...string)
Click to show internal directories.
Click to hide internal directories.