cek

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDebugMode

func WithDebugMode(ext *Extension)

WithDebugMode function

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

type ContentLayer struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

ContentLayer type

type Context

type Context struct {
	AudioPlayer *AudioPlayer `json:"AudioPlayer,omitempty"`
	System      *System      `json:"System"`
}

Context type

type Device

type Device struct {
	DeviceID string   `json:"deviceId"`
	Display  *Display `json:"display"`
}

Device 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 ExtensionOption

type ExtensionOption func(*Extension)

ExtensionOption type

type Header struct {
	MessageID string `json:"messageId"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

Header type

type Intent

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

Intent 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 Request

type Request interface {
	Request()
}

Request interface

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 NewResponseBuilder

func NewResponseBuilder() *ResponseBuilder

NewResponseBuilder function

func (*ResponseBuilder) AddDirective

func (b *ResponseBuilder) AddDirective(d *Directive) *ResponseBuilder

AddDirective method

func (*ResponseBuilder) Build

func (b *ResponseBuilder) Build() *ResponseMessage

Build 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 Size

type Size string

Size type

const (
	SizeNone   Size = "none"
	SizeS100   Size = "s100"
	SizeM100   Size = "m100"
	SizeL100   Size = "l100"
	SizeXL100  Size = "xl100"
	SizeCustom Size = "custom"
)

Size constants

type Slot

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

Slot type

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

Jump to

Keyboard shortcuts

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