Documentation
¶
Index ¶
- Variables
- func Invoke(params Params)
- func New(router http.Handler, getter dependency.ConfigGetter) *http.Server
- func StartServer(server Server, logger *zap.Logger) func(ctx context.Context) error
- func StopServer(server Server, logger *zap.Logger) func(ctx context.Context) error
- type Params
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var Service = dependency.Service{ ConfigFunc: func(flags dependency.FlagSet) { flags.String("server-host", "0.0.0.0", "The IP to start on") flags.Int("server-port", 8080, "The port to start the web Server on") flags.Duration("read-timeout", 10*time.Second, "The read timeout for the HTTP Server") flags.Duration("read-header-timeout", 20*time.Second, "The read header timeout for the HTTP Server") flags.Duration("write-timeout", 20*time.Second, "The write timeout for the HTTP Server") flags.Duration("idle-timeout", 10*time.Second, "The idle timeout for the HTTP Server") flags.Int("max-header-bytes", http.DefaultMaxHeaderBytes, "The maximum size that the HTTP header can be in bytes") }, Dependencies: fx.Provide( New, ), InvokeFunc: Invoke, Constructor: func(server *http.Server) Server { return server }, }
Service allows the service to be used in the dependency builder nolint: gomnd
Functions ¶
func New ¶
func New(router http.Handler, getter dependency.ConfigGetter) *http.Server
New creates a new instance of the *http.Server configured by the config you decided
func StartServer ¶
StartServer creates a closure that will start the server when called
Types ¶
Click to show internal directories.
Click to hide internal directories.