Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInterruptNotifier ¶
NewInterruptNotifier returns a channel wich is closed on a received interrupt
func NewTerminatedNotifier ¶
func NewTerminatedNotifier() chan struct{}
NewTerminatedNotifier creates a channel which can be used to listen to the termination of the server group
Types ¶
type BlazeServer ¶
type BlazeServer interface { //Start starts a server which waits on close of the interrupt channel and modifies the wg Start(interrupt chan struct{}, wg *sync.WaitGroup) //Walk prints the registered routes Walk() }
BlazeServer defines a blaze server
type BlazeServerBuilder ¶
type BlazeServerBuilder interface { //Add Middleware adds one or many middlewares to the server AddMiddleware(middlewares ...func(http.Handler) http.Handler) //AddServerMount Adds Mountpoints to the server AddServerMount(svm ...BlazeServiceMount) //Build creates the server Build() BlazeServer }
BlazeServerBuilder is a Builder for blaze servers
func NewServerBuilder ¶
func NewServerBuilder(listenAddr string, logger logr.Logger, opts ...Option) BlazeServerBuilder
NewServerBuilder creates a new server Builder
type BlazeServerGroup ¶
type BlazeServerGroup interface { //Start starts all registered servers Start() //GetTerminationNotfier returns a channel which will be closed on termination of all servers GetTerminationNotfier() chan struct{} //Wait blocks until all servers are terminated Wait() }
BlazeServerGroup defines a BlazeServerGroup
func NewBlazeServerGroup ¶
func NewBlazeServerGroup(interrupt chan struct{}, terminated chan struct{}, servers ...BlazeServer) BlazeServerGroup
NewBlazeServerGroup creates a new server group
func NewServerGroupFromBuilders ¶
func NewServerGroupFromBuilders(interrupt chan struct{}, terminated chan struct{}, printRoutes bool, builder ...BlazeServerBuilder) BlazeServerGroup
NewServerGroupFromBuilders creates a server group from builders as a convenience function
type BlazeServiceMount ¶
BlazeServiceMount defines a Service and a list of mountpoints e.g "/", "prefix"
func NewBlazeServiceMount ¶
func NewBlazeServiceMount(srv blaze.Service, paths ...string) BlazeServiceMount
NewBlazeServiceMount creates a new ServiceMount
type Option ¶
type Option func(*Options)
Option is a functional option for extending a Blaze server.
func WithIdleTimeout ¶ added in v0.2.3
WithIdleTimeout allows to set the IdleTimeout to use by a server
func WithMux ¶
func WithMux(mux *chi.Mux) Option
WithMux allows to set the chi mux to use by a server
func WithReadTimeout ¶ added in v0.2.3
WithReadTimeout allows to set the ReadTimeout to use by a server
func WithWriteTimeout ¶ added in v0.2.3
WithWriteTimeout allows to set the WriteTimeout to use by a server