Documentation
¶
Overview ¶
Package server contains the ClientAPI HTTP-REST and MarbleAPI gRPC server.
Index ¶
- func CreateServeMux(cc core.ClientCore) *http.ServeMux
- func RunClientServer(mux *http.ServeMux, address string, tlsConfig *tls.Config, ...)
- func RunMarbleServer(core *core.Core, addr string, addrChan chan string, errChan chan error, ...)
- func RunPrometheusServer(address string, zapLogger *zap.Logger)
- type GeneralResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateServeMux ¶
func CreateServeMux(cc core.ClientCore) *http.ServeMux
CreateServeMux creates a mux that serves the client API.
func RunClientServer ¶
func RunClientServer(mux *http.ServeMux, address string, tlsConfig *tls.Config, zapLogger *zap.Logger)
RunClientServer runs a HTTP server serving mux.
func RunMarbleServer ¶
func RunMarbleServer(core *core.Core, addr string, addrChan chan string, errChan chan error, zapLogger *zap.Logger)
RunMarbleServer starts a gRPC with the given Coordinator core. `address` is the desired TCP address like "localhost:0". The effective TCP address is returned via `addrChan`.
func RunPrometheusServer ¶ added in v0.1.1
RunPrometheusServer runs a HTTP server handling the prometheus metrics endpoint
Types ¶
type GeneralResponse ¶ added in v0.3.1
type GeneralResponse struct { Status string `json:"status"` Data interface{} `json:"data"` Message string `json:"message,omitempty"` // only used when status = "error" }
GeneralResponse is a wrapper for all our REST API responses to follow the JSend style: https://github.com/omniti-labs/jsend
Click to show internal directories.
Click to hide internal directories.