Skip to content

Commit 4af3229

Browse files
committed
Clarify on the repository contents
- shows there are two options now and how they may differ Signed-off-by: Alex Ellis (VMware) <[email protected]>
1 parent 619ce2c commit 4af3229

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
OpenFaaS Golang HTTP templates
22
=============================================
33

4-
## golang-http
4+
This repository contains two Golang templates for OpenFaaS which give additional control over the HTTP request and response. They will both handle higher throughput than the classic watchdog due to the process being kept warm.
5+
6+
```
7+
$ faas template pull https://github.com/openfaas-incubator/golang-http-template
8+
$ faas new --list
9+
10+
Languages available as templates:
11+
- golang-http
12+
- golang-middleware
13+
```
14+
15+
The two templates are equivalent with `golang-http` using a structured request/response object and the alternative implementing a Golang `http.HandleFunc` from the Golang stdlib. `golang-http` is more "conventional" for a Golang serverless template but this is a question of style/taste.
16+
17+
## 1.0 golang-http
518

619
This template provides additional context and control over the HTTP response from your function.
720

@@ -117,7 +130,7 @@ func Handle(req handler.Request) (handler.Response, error) {
117130
}
118131
```
119132

120-
## golang-middleware
133+
## 2.0 golang-middleware
121134

122135
This template uses the [http.HandlerFunc](https://golang.org/pkg/net/http/#HandlerFunc) as entry point.
123136

0 commit comments

Comments
 (0)