This repository was archived by the owner on Jul 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change
1
+ .idea
Original file line number Diff line number Diff line change 1
1
# go-function-sdk
2
- An SDK for building functions in Go
2
+ An SDK for building OpenFaaS functions in Go
3
+
4
+
5
+ ## Installing
6
+
7
+ Use ` go get ` to retrieve the SDK to add it to your ` GOPATH ` workspace, or
8
+ project's Go module dependencies.
9
+
10
+ go get github.com/openfaas-incubator/go-function-sdk
11
+
12
+ To update the SDK use ` go get -u ` to retrieve the latest version of the SDK.
13
+
14
+ go get -u github.com/openfaas-incubator/go-function-sdk
15
+
16
+
17
+ ## Features
18
+
19
+ ### Handler definition
20
+ ``` go
21
+ type FunctionHandler interface {
22
+ Handle (req Request ) (Response, error )
23
+ }
24
+ ```
25
+
26
+ ` FunctionHandler ` interface is used by [ golang-http] ( https://github.com/openfaas-incubator/golang-http-template/tree/master/template/golang-http )
27
+ template to define a functions handler
28
+
29
+
30
+ ### Secrets
31
+ For the time being please use the secrets function from ` github.com/openfaas/openfaas-cloud/sdk `
32
+
33
+ See: https://github.com/openfaas/openfaas-cloud/blob/master/sdk/secrets.go
34
+
35
+ Usage:
36
+
37
+ ``` go
38
+ secret , err := sdk.ReadSecret (" MY_SECRET" )
39
+ if err != nil {
40
+ return fmt.Errorf (" error reading secret. %v " , err)
41
+ }
42
+ ```
You can’t perform that action at this time.
0 commit comments