ask

package
v0.0.0-...-4f19659 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Type    string `json:"type"`
	Title   string `json:"title,omitempty"`
	Content string `json:"content,omitempty"`
}

func NewCard

func NewCard(title string, content string) *Card

type Intent

type Intent struct {
	Name  string          `json:"name"`
	Slots map[string]Slot `json:"slots"`
}

type OutputSpeech

type OutputSpeech struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

func NewOutputSpeech

func NewOutputSpeech(text string) *OutputSpeech

type Reprompt

type Reprompt struct {
	OutputSpeech *OutputSpeech `json:"outputSpeech,omitempty"`
}

func NewReprompt

func NewReprompt(text string) *Reprompt

type Request

type Request struct {
	Version string   `json:"version"`
	Session *Session `json:"session"`
	Body    struct {
		Type      string `json:"type"`
		RequestID string `json:"requestId"`
		Timestamp string `json:"timestamp"`
		Intent    Intent `json:"intent,omitempty"`
		Reason    string `json:"reason,omitempty"`
	} `json:"request"`
}

func NewRequestFromJSON

func NewRequestFromJSON(reader io.Reader) (*Request, error)

func (*Request) IsIntentRequest

func (r *Request) IsIntentRequest() bool

func (*Request) IsLaunchRequest

func (r *Request) IsLaunchRequest() bool

func (*Request) IsSessionEndedRequest

func (r *Request) IsSessionEndedRequest() bool

func (*Request) SessionTerminationIsDueToError

func (r *Request) SessionTerminationIsDueToError() bool

func (*Request) SessionTerminationIsDueToMaxRepromptLimitExceeded

func (r *Request) SessionTerminationIsDueToMaxRepromptLimitExceeded() bool

func (*Request) SessionTerminationWasUserInitiated

func (r *Request) SessionTerminationWasUserInitiated() bool

func (*Request) String

func (r *Request) String() (string, error)

type Response

type Response struct {
	Version           string                 `json:"version"`
	SessionAttributes map[string]interface{} `json:"sessionAttributes,omitempty"`
	Body              *ResponseBody          `json:"response"`
}

func NewResponse

func NewResponse(req *Request) *Response

func (*Response) Bytes

func (r *Response) Bytes() ([]byte, error)

func (*Response) String

func (r *Response) String() (string, error)

type ResponseBody

type ResponseBody struct {
	OutputSpeech     *OutputSpeech `json:"outputSpeech,omitempty"`
	Card             *Card         `json:"card,omitempty"`
	Reprompt         *Reprompt     `json:"reprompt,omitempty"`
	ShouldEndSession bool          `json:"shouldEndSession"`
}

type Session

type Session struct {
	New         bool   `json:"new"`
	SessionID   string `json:"sessionId"`
	Application struct {
		ApplicationID string `json:"applicationId"`
	} `json:"application"`
	Attributes map[string]interface{} `json:"attributes"`
	User       struct {
		UserID string `json:"userId"`
	} `json:"user"`
}

type Slot

type Slot struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL