Skip to content
This repository was archived by the owner on Jul 23, 2020. It is now read-only.

Commit b0d5269

Browse files
ewildealexellis
authored andcommitted
Update README.md resolves #4
Signed-off-by: Edward Wilde <ewilde@gmail.com>
1 parent 76c04dc commit b0d5269

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
11
# 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+
```

0 commit comments

Comments
 (0)