-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalexa.go
57 lines (45 loc) · 1.41 KB
/
alexa.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright Philippe Thomassigny 2018-2020.
// Use of this source code is governed by a MIT licence.
// license that can be found in the LICENSE file.
// Package alexa is a framework ready-to-go to build Apps for Lambda servers for Amazon Alexa
//
package alexa
import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/webability-go/alexa/dynamodb"
"github.com/webability-go/alexa/request"
)
const VERSION = "0.4.0"
var DEVEL = false
var ERRORCAPTURE = true
/*
Alexa Lamdba Library Manager for GO
This is an implementation for a Full functional lamdba function for Alexa.
Build the skill overloading the default event handlers and adding your own event handlers
Log:
2019-03-27: Phil, Creation
2019-04-01: Phil, Add Dynamodb support
*/
func init() {
BuildDefaultMap()
}
// Anything we need to make alexa work
func Start() error {
if dynamodb.DDB_tablename != "" {
err := dynamodb.StartDynamoTable()
if err != nil {
return err
}
}
lambda.Start(DefaultHandler)
return nil
}
func SetErrorCapture(status bool) {
ERRORCAPTURE = status
}
/* ==========================================================================
HIJACK THE SESSION UNMARSHAL ON THE REQUEST TO REPLACE ATTRIBUTES
==========================================================================*/
func SetSessionUnmarshalerHandler(unmarshaler func(data []byte, s *request.Session) error) {
request.SessionUnmarshalerHandler = unmarshaler
}