Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.18 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.18 KB

golexa

Codacy Badge License

Usage

The Golexa struct is the initial interface point with the SDK. Alexa must be initialized first. The struct is defined as:

type Golexa struct {
	Triggerable    Triggerable
	AlexaRequest   *AlexaRequest
	TranslationMap map[string]map[string]string
}

Golexa embeds the Triggerable interface, whose methods must be implemented

type Triggerable interface {
	OnLaunch(ctx context.Context, req AlexaRequest, resp *AlexaResponse) error
	OnIntent(ctx context.Context, req AlexaRequest, resp *AlexaResponse) error
}

By calling

var gxa = &Golexa{...}
gxa.LambdaStart()

the functions defined in the Triggerable interface are triggered.

Example

You can see a complete example of how to use Golexa here