Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type HTTPServer
- type ReConfiguration
- func (reConfiguration *ReConfiguration) Name() string
- func (reConfiguration *ReConfiguration) Process(ctx context.Context) error
- func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
- func (reConfiguration *ReConfiguration) Server() Server
- func (reConfiguration *ReConfiguration) SetServer(server Server)
- func (reConfiguration *ReConfiguration) Start(ctx context.Context)
- func (reConfiguration *ReConfiguration) Stop()
- type Server
Constants ¶
View Source
const ( InterfaceFieldName = "server.http.interface" PortFieldName = "server.http.port" ShutdownTimeoutFieldName = "server.http.timeout.shutdown" InterfaceDefault = "0.0.0.0" PortDefault = uint16(8080) ShutdownTimeoutDefault = 30 * time.Second )
Variables ¶
View Source
var Component = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, router.Component, runner.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewReConfigurationWithConfigurator, ) }), BindFlags: app.BindFlags(func(flagSet *pflag.FlagSet, container container.Container) error { return container.Invoke(func(config *Config) { flagSet.StringVar(&config.Interface, InterfaceFieldName, InterfaceDefault, "interface for listening to incoming requests") flagSet.Uint16Var(&config.Port, PortFieldName, PortDefault, "port for listening to incoming requests") flagSet.DurationVar( &config.ShutdownTimeout, ShutdownTimeoutFieldName, ShutdownTimeoutDefault, "timeout during which the HTTP server must be turned off after receiving a shutdown signal", ) }) }), Run: app.Run(func(container container.Container) error { return container.Invoke(func( server *ReConfiguration, reConfiguration re_configuration.ReConfiguration, informer logger.Informer, config *Config, runner runner.Runner, ) error { reConfiguration.Registration(server) informer.Info("http.server: registration in the reConfigurator") return runner.AddProcesses(server) }) }), }
Functions ¶
This section is empty.
Types ¶
type Config ¶
func Configuration ¶
func Configuration(config *Config, configurator configurator.Configurator) *Config
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewWithConfigurator ¶
func NewWithConfigurator(configurator configurator.Configurator, config *Config, router router.Router, logger logger.Logger) *HTTPServer
func (*HTTPServer) Name ¶
func (server *HTTPServer) Name() string
type ReConfiguration ¶
type ReConfiguration struct {
// contains filtered or unexported fields
}
func NewReConfiguration ¶
func NewReConfigurationWithConfigurator ¶
func NewReConfigurationWithConfigurator(logger logger.Logger, router router.Router, config *Config, configurator configurator.Configurator) *ReConfiguration
func (*ReConfiguration) Name ¶
func (reConfiguration *ReConfiguration) Name() string
func (*ReConfiguration) Process ¶
func (reConfiguration *ReConfiguration) Process(ctx context.Context) error
func (*ReConfiguration) ReConfiguration ¶
func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
func (*ReConfiguration) Server ¶
func (reConfiguration *ReConfiguration) Server() Server
func (*ReConfiguration) SetServer ¶
func (reConfiguration *ReConfiguration) SetServer(server Server)
func (*ReConfiguration) Start ¶
func (reConfiguration *ReConfiguration) Start(ctx context.Context)
func (*ReConfiguration) Stop ¶
func (reConfiguration *ReConfiguration) Stop()
Click to show internal directories.
Click to hide internal directories.