Documentation ¶
Index ¶
- func StartConfigAPI(eventtypes event.Service, functions function.Service, ...)
- func StartEventsAPI(router http.Handler, config ServerConfig)
- type CORSResponse
- type Error
- type EventTypesResponse
- type FunctionsResponse
- type HTTPAPI
- type Response
- type Server
- type ServerConfig
- type SubscriptionsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartConfigAPI ¶
func StartConfigAPI(eventtypes event.Service, functions function.Service, subscriptions subscription.Service, corses cors.Service, config ServerConfig)
StartConfigAPI creates a new configuration API server and listens for requests.
func StartEventsAPI ¶
func StartEventsAPI(router http.Handler, config ServerConfig)
StartEventsAPI creates a new gateway endpoint and listens for requests.
Types ¶
type CORSResponse ¶
CORSResponse is a HTTPAPI JSON response containing cors configuration.
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error represents generic HTTP error returned by Configuration and Events API.
type EventTypesResponse ¶
EventTypesResponse is a HTTPAPI JSON response containing event types.
type FunctionsResponse ¶
FunctionsResponse is a HTTPAPI JSON response containing functions.
type HTTPAPI ¶
type HTTPAPI struct { EventTypes event.Service Functions function.Service Subscriptions subscription.Service CORSes cors.Service }
HTTPAPI exposes REST API for configuring EG
func (HTTPAPI) RegisterRoutes ¶
func (h HTTPAPI) RegisterRoutes(router *httprouter.Router)
RegisterRoutes register HTTP API routes
type Response ¶
type Response struct {
Errors []Error `json:"errors"`
}
Response is a generic response object from Configuration and Events API.
type Server ¶
type Server struct { Config ServerConfig HTTPHandler *http.Server }
Server is a context-aware http server.
type ServerConfig ¶
type ServerConfig struct { Log *zap.Logger TLSCrt *string TLSKey *string Port uint ShutdownGuard *sync.ShutdownGuard }
ServerConfig contains information for an HTTP listener to interact with its environment.
type SubscriptionsResponse ¶
type SubscriptionsResponse struct {
Subscriptions subscription.Subscriptions `json:"subscriptions"`
}
SubscriptionsResponse is a HTTPAPI JSON response containing subscriptions.