Files
faas/gateway/vendor/github.com/openfaas/faas-provider
Alex Ellis (VMware) b4a550327d Re-vendor queue-worker publisher for reconnect
- re-vendor queue-worker for publisher via 0.6.0
- bump queue-worker version to 0.6.0 in docker-compose.yml for
AMD64
- use new naming for NATS of nats -> NATS in variables where
required
- add default reconnect of 60 times, 2 seconds apart.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2019-01-29 15:15:48 +00:00
..
2018-09-06 16:14:53 +01:00
2018-09-06 16:14:53 +01:00

faas-provider

This is a common template or interface for you to start building your own OpenFaaS backend.

Checkout the backends guide here before starting.

OpenFaaS projects use the MIT License and are written in Golang. We encourage the same for external / third-party providers.

How to use this code

We will setup all the standard HTTP routes for you, then start listening on a given TCP port - it should be 8080.

Just implement the supplied routes.

For an example checkout the server.go file in the faas-netes Kubernetes backend.

I.e.:

	bootstrapHandlers := bootTypes.FaaSHandlers{
		FunctionProxy:  handlers.MakeProxy(),
		DeleteHandler:  handlers.MakeDeleteHandler(clientset),
		DeployHandler:  handlers.MakeDeployHandler(clientset),
		FunctionReader: handlers.MakeFunctionReader(clientset),
		ReplicaReader:  handlers.MakeReplicaReader(clientset),
		ReplicaUpdater: handlers.MakeReplicaUpdater(clientset),
		InfoHandler:    handlers.MakeInfoHandler(),
	}
	var port int
	port = 8080
	bootstrapConfig := bootTypes.FaaSConfig{
		ReadTimeout:  time.Second * 8,
		WriteTimeout: time.Second * 8,
		TCPPort:      &port,
	}

	bootstrap.Serve(&bootstrapHandlers, &bootstrapConfig)