Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProtocolFieldName = "server.socket.protocol" InterfaceFieldName = "server.socket.interface" PortFieldName = "server.socket.port" ProtocolTCP = "tcp" ProtocolUDP = "udp" ProtocolDefault = ProtocolTCP InterfaceDefault = "0.0.0.0" PortDefault = uint16(8081) )
Variables ¶
View Source
var Component = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewWithConfigurator, ) }), BindFlags: app.BindFlags(func(flagSet *pflag.FlagSet, container container.Container) error { return container.Invoke(func(config *Config) { flagSet.StringVar(&config.Protocol, ProtocolFieldName, ProtocolDefault, fmt.Sprintf( "listening protocol. Availability protocols [%s]", strings.Join([]string{ProtocolTCP, ProtocolUDP}, ","), )) flagSet.StringVar(&config.Interface, InterfaceFieldName, InterfaceDefault, "listening interface") flagSet.Uint16Var(&config.Port, PortFieldName, PortDefault, "listening port") }) }), }
Functions ¶
Types ¶
type Config ¶
func Configuration ¶
func Configuration(config *Config, configurator configurator.Configurator) *Config
type Listener ¶
func NewWithConfigurator ¶
func NewWithConfigurator(config *Config, configurator configurator.Configurator, informer logger.Informer) (Listener, error)
Click to show internal directories.
Click to hide internal directories.