Documentation ¶
Index ¶
Constants ¶
View Source
const ( PortConfigKey = "http-port" GracePeriodConfigKey = "http-grace-period" )
View Source
const DefaultGracePeriod = 3 * time.Second
View Source
const DefaultHealthEndpoint = "/health"
View Source
const DefaultLoggingMiddlewareEnabled = true
View Source
const DefaultName = "default"
View Source
const DefaultPort = "8080"
View Source
const DefaultPrometheusMiddlewareEnabled = true
Variables ¶
This section is empty.
Functions ¶
func Flags ¶
Flags is a convenience function to quickly add the HTTP server options as CLI flags Implements the cli.FlagProvider type
func NewFileServer ¶
func NewFileServer(filePath string) *swaggerHandler
Types ¶
type Option ¶
type Option func(*Options)
func DisableLoggingMiddleware ¶
func DisableLoggingMiddleware() Option
func HealthEndpoint ¶
func LoggingSkipEndpoints ¶
func ShutdownGracePeriod ¶
type Server ¶
type Server interface { ListenAndServe(ctx context.Context, wg *sync.WaitGroup) Handle(endpoint string, handler http.Handler) }
func NewDebugServer ¶
NewDebugServer is a convenience wrapper to quickly create a HTTP server, serving on port 3000. The server has the prometheus HTTP handler attached to '/metrics'.
Click to show internal directories.
Click to hide internal directories.