deferred

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSender

type EventSender interface {
	Send(ctx context.Context, resp *alexa.Response) error
}

EventSender publishes a response back to the smart home event api

type EventSenderFunc

type EventSenderFunc func(ctx context.Context, resp *alexa.Response) error

EventSenderFunc publishes a response back to the smart home event api

func (EventSenderFunc) Send

func (e EventSenderFunc) Send(ctx context.Context, resp *alexa.Response) error

Send publishes a response back to the smart home event api

type HTTPEventSender

type HTTPEventSender struct {
	TokenStore   alexa.TokenReaderWriter
	UserIDReader alexa.UserIDReader
	ClientID     string
	ClientSecret string
}

HTTPEventSender sends responses to the smart home api with the credentials of the user.

func (*HTTPEventSender) Send

func (h *HTTPEventSender) Send(ctx context.Context, resp *alexa.Response) error

Send responses to the smart home api with the credentials of the user.

type Handler

type Handler struct {
	RequestHandler alexa.Handler
	EventSender    EventSender
}

Handler coordinates handling a request and sending the response back to the smart home event api

func (*Handler) HandleRequest

func (h *Handler) HandleRequest(ctx context.Context, req *alexa.Request) error

HandleRequest passes the request to the RequestHandler. If response is returned it is published via the EventSender. An error of type SendError indicates the request was successful but the response failed to be sent.

type SendError

type SendError struct {
	// contains filtered or unexported fields
}

SendError is an error sending to the smart home event api

func (*SendError) Error

func (r *SendError) Error() string

Jump to

Keyboard shortcuts

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