Documentation ¶
Index ¶
- func WithDebugMode(ext *Extension)
- type Application
- type AudioPlayer
- type ContentLayer
- type Context
- type Device
- type Directive
- type Display
- type Event
- type EventRequest
- type Extension
- type ExtensionOption
- type Header
- type Intent
- type IntentRequest
- type LaunchRequest
- type Orientation
- type OutputSpeech
- type OutputSpeechBuilder
- func (b *OutputSpeechBuilder) AddSpeechText(text string, lang SpeechInfoLang) *OutputSpeechBuilder
- func (b *OutputSpeechBuilder) AddSpeechURL(url string) *OutputSpeechBuilder
- func (b *OutputSpeechBuilder) Build() *OutputSpeech
- func (b *OutputSpeechBuilder) SpeechSet(brief *SpeechInfo, verbose *Verbose) *OutputSpeechBuilder
- type OutputSpeechType
- type OutputSpeechVerboseType
- type PlayerActivity
- type Reprompt
- type Request
- type RequestMessage
- type RequestType
- type Response
- type ResponseBuilder
- func (b *ResponseBuilder) AddDirective(d *Directive) *ResponseBuilder
- func (b *ResponseBuilder) Build() *ResponseMessage
- func (b *ResponseBuilder) OutputSpeech(os *OutputSpeech) *ResponseBuilder
- func (b *ResponseBuilder) Reprompt(os *OutputSpeech) *ResponseBuilder
- func (b *ResponseBuilder) SessionAttributes(attributes map[string]string) *ResponseBuilder
- func (b *ResponseBuilder) ShouldEndSession(v bool) *ResponseBuilder
- type ResponseMessage
- type Session
- type SessionEndedRequest
- type Size
- type Slot
- type SpeechInfo
- type SpeechInfoArray
- type SpeechInfoLang
- type SpeechInfoType
- type SpeechInfoValues
- type System
- type User
- type Verbose
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct {
ApplicationID string `json:"applicationId"`
}
Application type
type AudioPlayer ¶
type AudioPlayer struct { OffsetInMilliseconds int `json:"offsetInMilliseconds,omitempty"` PlayerActivity PlayerActivity `json:"playerActivity"` Stream interface{} `json:"stream,omitempty"` TotalInMilliseconds int `json:"totalInMilliseconds,omitempty"` }
AudioPlayer type
type ContentLayer ¶
ContentLayer type
type Context ¶
type Context struct { AudioPlayer *AudioPlayer `json:"AudioPlayer,omitempty"` System *System `json:"System"` }
Context type
type Directive ¶
type Directive struct { Header *Header `json:"header"` Payload interface{} `json:"payload"` }
Directive type
type Display ¶
type Display struct { ContentLayer *ContentLayer `json:"contentLayer,omitempty"` DPI int `json:"dpi,omitempty"` Orientation Orientation `json:"orientation,omitempty"` Size Size `json:"size"` }
Display type
type Event ¶
type Event struct { Name string `json:"name"` Namespace string `json:"namespace"` Payload interface{} `json:"payload"` }
Event type
type EventRequest ¶
type EventRequest struct { Event *Event `json:"event"` RequestID string `json:"requestId"` Timestamp string `json:"timestamp"` }
EventRequest type
func (*EventRequest) Request ¶
func (*EventRequest) Request()
Request method for implementing Request interface
type Extension ¶
type Extension struct { ID string // contains filtered or unexported fields }
Extension type
func NewExtension ¶
func NewExtension(extensionID string, options ...ExtensionOption) *Extension
NewExtension function
func (*Extension) ParseRequest ¶
func (e *Extension) ParseRequest(r *http.Request) (*RequestMessage, error)
ParseRequest method
type Header ¶
type Header struct { MessageID string `json:"messageId"` Name string `json:"name"` Namespace string `json:"namespace"` }
Header type
type IntentRequest ¶
type IntentRequest struct {
Intent *Intent `json:"intent"`
}
IntentRequest type
func (*IntentRequest) Request ¶
func (*IntentRequest) Request()
Request method for implementing Request interface
type LaunchRequest ¶
type LaunchRequest struct { }
LaunchRequest type
func (*LaunchRequest) Request ¶
func (*LaunchRequest) Request()
Request method for implementing Request interface
type Orientation ¶
type Orientation string
Orientation type
const ( OrientationLandscape Orientation = "landscape" OrientationPortrait Orientation = "portrait" )
Orientation constants
type OutputSpeech ¶
type OutputSpeech struct { Brief *SpeechInfo `json:"brief,omitempty"` Type OutputSpeechType `json:"type"` Values SpeechInfoValues `json:"values,omitempty"` Verbose *Verbose `json:"verbose,omitempty"` }
OutputSpeech type
type OutputSpeechBuilder ¶
type OutputSpeechBuilder struct {
// contains filtered or unexported fields
}
OutputSpeechBuilder type
func NewOutputSpeechBuilder ¶
func NewOutputSpeechBuilder() *OutputSpeechBuilder
NewOutputSpeechBuilder function
func (*OutputSpeechBuilder) AddSpeechText ¶
func (b *OutputSpeechBuilder) AddSpeechText(text string, lang SpeechInfoLang) *OutputSpeechBuilder
AddSpeechText method
func (*OutputSpeechBuilder) AddSpeechURL ¶
func (b *OutputSpeechBuilder) AddSpeechURL(url string) *OutputSpeechBuilder
AddSpeechURL method
func (*OutputSpeechBuilder) Build ¶
func (b *OutputSpeechBuilder) Build() *OutputSpeech
Build method
func (*OutputSpeechBuilder) SpeechSet ¶
func (b *OutputSpeechBuilder) SpeechSet(brief *SpeechInfo, verbose *Verbose) *OutputSpeechBuilder
SpeechSet method
type OutputSpeechType ¶
type OutputSpeechType string
OutputSpeechType type
const ( OutputSpeechTypeSimpleSpeech OutputSpeechType = "SimpleSpeech" OutputSpeechTypeSpeechList OutputSpeechType = "SpeechList" OutputSpeechTypeSpeechSet OutputSpeechType = "SpeechSet" )
OutputSpeechType constants
type OutputSpeechVerboseType ¶
type OutputSpeechVerboseType string
OutputSpeechVerboseType type
const ( OutputSpeechVerboseTypeSimpleSpeech OutputSpeechVerboseType = "SimpleSpeech" OutputSpeechVerboseTypeSpeechList OutputSpeechVerboseType = "SpeechList" )
OutputSpeechVerboseType constants
type PlayerActivity ¶
type PlayerActivity string
PlayerActivity type
const ( PlayerActivityIDLE PlayerActivity = "IDLE" PlayerActivityPLAYING PlayerActivity = "PLAYING" PlayerActivityPAUSED PlayerActivity = "PAUSED" PlayerActivitySTOPPED PlayerActivity = "STOPPED" )
PlayerActivity constants
type Reprompt ¶
type Reprompt struct {
OutputSpeech *OutputSpeech `json:"outputSpeech"`
}
Reprompt type
type RequestMessage ¶
type RequestMessage struct { Context *Context `json:"context"` Request Request `json:"request"` Session *Session `json:"session"` Version string `json:"version"` }
RequestMessage type
func (*RequestMessage) UnmarshalJSON ¶
func (m *RequestMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON method for RequestMessage
type RequestType ¶
type RequestType string
RequestType type
const ( RequestTypeEvent RequestType = "EventRequest" RequestTypeIntent RequestType = "IntentRequest" RequestTypeLaunch RequestType = "LaunchRequest" RequestTypeSessionEnded RequestType = "SessionEndedRequest" )
RequestType constants
type Response ¶
type Response struct { Card interface{} `json:"card"` Directives []*Directive `json:"directives"` OutputSpeech *OutputSpeech `json:"outputSpeech"` Reprompt *Reprompt `json:"reprompt,omitempty"` ShouldEndSession bool `json:"shouldEndSession"` }
Response type
type ResponseBuilder ¶
type ResponseBuilder struct {
// contains filtered or unexported fields
}
ResponseBuilder type
func (*ResponseBuilder) AddDirective ¶
func (b *ResponseBuilder) AddDirective(d *Directive) *ResponseBuilder
AddDirective method
func (*ResponseBuilder) OutputSpeech ¶
func (b *ResponseBuilder) OutputSpeech(os *OutputSpeech) *ResponseBuilder
OutputSpeech method
func (*ResponseBuilder) Reprompt ¶
func (b *ResponseBuilder) Reprompt(os *OutputSpeech) *ResponseBuilder
Reprompt method
func (*ResponseBuilder) SessionAttributes ¶
func (b *ResponseBuilder) SessionAttributes(attributes map[string]string) *ResponseBuilder
SessionAttributes method
func (*ResponseBuilder) ShouldEndSession ¶
func (b *ResponseBuilder) ShouldEndSession(v bool) *ResponseBuilder
ShouldEndSession method
type ResponseMessage ¶
type ResponseMessage struct { Response *Response `json:"response"` SessionAttributes map[string]string `json:"sessionAttributes"` Version string `json:"version"` }
ResponseMessage type
type Session ¶
type Session struct { New bool `json:"new"` SessionAttributes map[string]string `json:"sessionAttributes"` SessionID string `json:"sessionId"` User *User `json:"user"` }
Session type
type SessionEndedRequest ¶
type SessionEndedRequest struct { }
SessionEndedRequest type
func (*SessionEndedRequest) Request ¶
func (*SessionEndedRequest) Request()
Request method for implementing Request interface
type SpeechInfo ¶
type SpeechInfo struct { Lang SpeechInfoLang `json:"lang"` Type SpeechInfoType `json:"type"` Value string `json:"value"` }
SpeechInfo type
func (*SpeechInfo) SpeechInfoValues ¶
func (*SpeechInfo) SpeechInfoValues()
SpeechInfoValues method for implementing SpeechInfoValues interface
type SpeechInfoArray ¶
type SpeechInfoArray []*SpeechInfo
SpeechInfoArray type
func (SpeechInfoArray) SpeechInfoValues ¶
func (SpeechInfoArray) SpeechInfoValues()
SpeechInfoValues method for implementing SpeechInfoValues interface
type SpeechInfoLang ¶
type SpeechInfoLang string
SpeechInfoLang type
const ( SpeechInfoLangEN SpeechInfoLang = "en" SpeechInfoLangJA SpeechInfoLang = "ja" SpeechInfoLangKO SpeechInfoLang = "ko" SpeechInfoLangEmpty SpeechInfoLang = "" )
SpeechInfoLang constants
type SpeechInfoType ¶
type SpeechInfoType string
SpeechInfoType type
const ( SpeechInfoTypePlainText SpeechInfoType = "PlainText" SpeechInfoTypeURL SpeechInfoType = "URL" )
SpeechInfoType constants
type SpeechInfoValues ¶
type SpeechInfoValues interface {
SpeechInfoValues()
}
SpeechInfoValues type
type System ¶
type System struct { Application *Application `json:"application"` Device *Device `json:"device"` User *User `json:"user"` }
System type
type User ¶
type User struct { UserID string `json:"userId"` AccessToken string `json:"accessToken,omitempty"` }
User type
type Verbose ¶
type Verbose struct { Type OutputSpeechVerboseType `json:"type"` Values SpeechInfoValues `json:"values"` }
Verbose type