Documentation ¶
Index ¶
- Constants
- func CreateHandlerAWS(key string, awsConfig *conf.AWSConfig, enterpriseSystem enterprise.Enterprise, ...) (handler awshandler.HandlerInterface, router *mux.Router, toListen bool)
- func CreateHandlerGCP(key string, gcpConfig *conf.AWSConfig, enterpriseSystem enterprise.Enterprise, ...) (handler awshandler.HandlerInterface, router *mux.Router, toListen bool)
- func Listen(config *conf.Config, serverWaitGroup *sync.WaitGroup, ...)
- func Main(config *conf.Config, onConfigChange <-chan string, cmd *cobra.Command, ...)
- type RouteWrapper
- type RouterWithCounter
Constants ¶
View Source
const Version = "0.0.16"
Variables ¶
This section is empty.
Functions ¶
func CreateHandlerAWS ¶
func CreateHandlerAWS(key string, awsConfig *conf.AWSConfig, enterpriseSystem enterprise.Enterprise, serverWaitGroup *sync.WaitGroup) (handler awshandler.HandlerInterface, router *mux.Router, toListen bool)
Create a handler from config
func CreateHandlerGCP ¶
func CreateHandlerGCP(key string, gcpConfig *conf.AWSConfig, enterpriseSystem enterprise.Enterprise, serverWaitGroup *sync.WaitGroup) (handler awshandler.HandlerInterface, router *mux.Router, toListen bool)
Create a handler from config
func Listen ¶
func Listen(config *conf.Config, serverWaitGroup *sync.WaitGroup, enterpriseSystem enterprise.Enterprise)
Listen for all configured services. Gets called when started or configs change
Types ¶
type RouteWrapper ¶
type RouteWrapper struct {
// contains filtered or unexported fields
}
Router with a lock
func (*RouteWrapper) ChangeRouter ¶
func (wrapper *RouteWrapper) ChangeRouter(newRouter *RouterWithCounter, oldHandler awshandler.HandlerInterface)
Switch router when config changes
func (*RouteWrapper) ServeHTTP ¶
func (wrapper *RouteWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
Interface implementation gets called on each request. Makes sure to use a lock in case router changes
type RouterWithCounter ¶
type RouterWithCounter struct {
// contains filtered or unexported fields
}
Mux router with counter to make sure we don't close anything in use
func (*RouterWithCounter) ServeHTTP ¶
func (router *RouterWithCounter) ServeHTTP(w http.ResponseWriter, r *http.Request)
Interface implementation gets called on each request that keeps track of current request count
func (*RouterWithCounter) ShutdownWhenReady ¶
func (router *RouterWithCounter) ShutdownWhenReady(handler awshandler.HandlerInterface)
Shutdown a handler if there are no current requests
Click to show internal directories.
Click to hide internal directories.