Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit cbbaea6

Browse files
author
Andres
committed
Upgrade Kubeless version to 0.6.0. Add golang example
1 parent f5b21c5 commit cbbaea6

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- docker
1111
env:
1212
global:
13-
- KUBELESS_VERSION: v0.5.0
13+
- KUBELESS_VERSION: v0.6.0
1414
- MINIKUBE_VERSION: v0.25.2
1515
- REPO_DOMAIN: serverless
1616
- REPO_NAME: serverless-kubeless

examples/post-go/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Simple Hello World function
2+
3+
This function returns the given data capitalizing the first word.
4+
5+
```console
6+
$ npm install
7+
$ serverless deploy
8+
$ serverless invoke -f go-echo -l --data 'hello!'
9+
Serverless: Calling function: go-echo...
10+
--------------------------------------------------------------------
11+
hello!
12+
$ serverless remove
13+
```

examples/post-go/handler.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package kubeless
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/kubeless/kubeless/pkg/functions"
7+
)
8+
9+
// Handler sample function with data
10+
func Handler(event functions.Event, context functions.Context) (string, error) {
11+
fmt.Println(event)
12+
return event.Data, nil
13+
}

examples/post-go/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "go-echo",
3+
"version": "1.0.0",
4+
"description": "Example function for serverless kubeless",
5+
"dependencies": {
6+
"serverless-kubeless": "^0.4.0"
7+
},
8+
"devDependencies": {},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"author": "",
13+
"license": "Apache-2.0"
14+
}

examples/post-go/serverless.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
service: go-echo
2+
3+
provider:
4+
name: kubeless
5+
runtime: go1.10
6+
7+
plugins:
8+
- serverless-kubeless
9+
10+
functions:
11+
go-echo:
12+
handler: handler.Handler

0 commit comments

Comments
 (0)