apex-go

Golang runtime for Apex/Lambda.

Github星跟踪图

Apex Golang

Golang runtime support for Apex/Lambda – providing handlers for Lambda sources, and runtime requirements such as implementing the Node.js shim stdio interface.

NOTE: apex v1.x supports native Go, so you should use https://github.com/aws/aws-lambda-go instead of this package.

Features

Currently supports:

  • Node.js shim
  • Environment variable population
  • Arbitrary JSON
  • CloudWatch Logs
  • Cognito
  • Kinesis
  • Dynamo
  • S3
  • SNS
  • SES

Example

package main

import (
  "encoding/json"
  "strings"

  "github.com/apex/go-apex"
)

type message struct {
  Value string `json:"value"`
}

func main() {
  apex.HandleFunc(func(event json.RawMessage, ctx *apex.Context) (interface{}, error) {
    var m message

    if err := json.Unmarshal(event, &m); err != nil {
      return nil, err
    }

    m.Value = strings.ToUpper(m.Value)

    return m, nil
  })
}

Run the program:

echo '{"event":{"value":"Hello World!"}}', go run main.go
{"value":{"value":"HELLO WORLD!"}}

Notes

Due to the Node.js shim required to run Go in Lambda, you must use stderr for logging – stdout is reserved for the shim.

Badges

Build Status
GoDoc



tjholowaychuk.com  · 
GitHub @tj  · 
Twitter @tjholowaychuk

主要指标

概览
名称与所有者apex/apex-go
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2016-01-27 00:08:36
推送于2018-01-18 00:00:47
最后一次提交2018-01-17 16:00:47
发布数1
最新版本名称v1.0.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数292
关注者数25
派生数31
提交数73
已启用问题?
问题数45
打开的问题数15
拉请求数19
打开的拉请求数1
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?