helloworld

command
v0.0.0-...-98e7844 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Microsoft Teams GoLang WebHook Sample

This sample uses the msteams-webhook-go library to build a simple 'Hello World' BOT WebHook for MS Teams.

Instructions assume OS X and the Amazon CLI

Build the sample:

GOOS=linux go build -o main

Package:

zip deployment.zip main

Update

You can create the lambda function by executing:

aws lambda create-function \
--region us-east-1 \
--function-name MSTeamsHelloWorld \
--zip-file fileb://./deployment.zip \
--runtime go1.x \
--role arn:aws:iam::<account-id>:role/<role> \
--handler main

aws lambda create-function
--region us-east-1
--function-name MSTeamsHelloWorld
--zip-file fileb://./deployment.zip
--runtime go1.x
--role arn:aws:iam::231107391174:role/lambda_basic_execution
--handler main

Configure API Gateway

Open the Lambda console in AWS and select your newly created function. Add an 'API Gateway' trigger, select a name for it, and change the permission to 'Open'.

Once saved it should display the URL to invoke the service. You can test it with curl:

curl -X POST -H "Content-Type: application/json" -d @TestRequest.json https://<id>.execute-api.us-east-1.amazonaws.com/prod/<name>

It should return:

{"type":"message","message":"Hello Tim Jones"}

Update

You can update the lambda function by re-compailing and packaging and then executing:

aws lambda update-function-code \
  --function-name MSTeamsHelloWorld \
  --zip-file fileb://./deployment.zip

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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