Documentation
¶
Overview ¶
Package common contains all models and interfaces necessary to access api
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConstMessageID = ""
ConstMessageID is used to ensure a constant messageId for tests
Functions ¶
This section is empty.
Types ¶
type AlexaError ¶
AlexaError is an error which additional holds the alexa error type https://developer.amazon.com/de/docs/device-apis/alexa-errorresponse.html#example-errorresponse
func NewAcceptGrantFailedError ¶
func NewAcceptGrantFailedError(message string) AlexaError
NewAcceptGrantFailedError creates an AlexaError to indicate that user authentication failed
func NewInternalError ¶
func NewInternalError(message string) AlexaError
NewInternalError creates an AlexaError to indicate an error that cannot be accurately described as one of the other error types occurred while you were handling the directive. For example, a generic runtime exception occurred while handling a directive. Ideally, you will never send this error event, but instead send a more specific error type.
func NewInvalidDirectiveError ¶
func NewInvalidDirectiveError(message string) AlexaError
NewInvalidDirectiveError creates an AlexaError to indicate a directive is not valid for this skill or is malformed.
func (AlexaError) Error ¶
func (e AlexaError) Error() string
type Context ¶
type Context struct {
Properties []property `json:"properties"`
}
Context holds properties of an endpoint
func (*Context) AddEndpointHealthProperty ¶
func (c *Context) AddEndpointHealthProperty(health capabilities.HealthConscious, timeOfSample time.Time)
AddEndpointHealthProperty adds a connectivity property to context
func (*Context) AddPowerStateProperty ¶
AddPowerStateProperty adds a powerState property to context
type Cookie ¶
The Cookie represents custom properties of an alexa endpoint and is used to create an device with the DeviceFactory which can be processed by the according directive processor.
type Directive ¶
type Directive struct {
Header *Header `json:"header"`
Endpoint *Endpoint `json:"endpoint,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
}
A Directive got sent by alexa
func NewDirective ¶
NewDirective creates a new directive from json
type Endpoint ¶
type Endpoint struct {
Scope struct {
Type string `json:"type"`
Token string `json:"token"`
} `json:"scope"`
EndpointID string `json:"endpointId"`
Cookie Cookie `json:"cookie"`
}
An Endpoint object identifies the target for a directive and the origin of an event.
type Header ¶
type Header struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
MessageID string `json:"messageId"`
CorrelationToken string `json:"correlationToken,omitempty"`
PayloadVersion string `json:"payloadVersion"`
}
A Header has a set of expected fields that are the same across message types. These provide different types of identifying information.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package capabilities contains the interfaces which capable devices must satisfy
|
Package capabilities contains the interfaces which capable devices must satisfy |