Documentation
¶
Index ¶
- type Config
- type LoggingMiddleware
- type PrometheusMiddleware
- type Server
- func (s *Server) ErrorResponse(w http.ResponseWriter, r *http.Request, error string, code int)
- func (s *Server) JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
- func (s *Server) JSONResponseCode(w http.ResponseWriter, r *http.Request, result interface{}, responseCode int)
- func (s *Server) ListenAndServe(stopCh <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HttpClientTimeout time.Duration `mapstructure:"http-client-timeout"`
HttpServerTimeout time.Duration `mapstructure:"http-server-timeout"`
HttpServerShutdownTimeout time.Duration `mapstructure:"http-server-shutdown-timeout"`
BackendURL string `mapstructure:"backend-url"`
UIMessage string `mapstructure:"ui-message"`
UIColor string `mapstructure:"ui-color"`
UIPath string `mapstructure:"ui-path"`
DataPath string `mapstructure:"data-path"`
ConfigPath string `mapstructure:"config-path"`
Port string `mapstructure:"port"`
PortMetrics int `mapstructure:"port-metrics"`
Hostname string `mapstructure:"hostname"`
RandomDelay bool `mapstructure:"random-delay"`
RandomError bool `mapstructure:"random-error"`
JWTSecret string `mapstructure:"jwt-secret"`
}
type LoggingMiddleware ¶
type LoggingMiddleware struct {
// contains filtered or unexported fields
}
func NewLoggingMiddleware ¶
func NewLoggingMiddleware(logger *zap.Logger) *LoggingMiddleware
type PrometheusMiddleware ¶
type PrometheusMiddleware struct {
Histogram *prometheus.HistogramVec
Counter *prometheus.CounterVec
}
func NewPrometheusMiddleware ¶
func NewPrometheusMiddleware() *PrometheusMiddleware
Source Files
¶
- chunked.go
- configs.go
- delay.go
- echo.go
- echows.go
- env.go
- headers.go
- health.go
- http.go
- index.go
- info.go
- logging.go
- metrics.go
- mock.go
- panic.go
- server.go
- status.go
- store.go
- token.go
- version.go
Click to show internal directories.
Click to hide internal directories.