Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMiddlewares ¶
func DefaultMiddlewares(logger *logrus.Logger) []echo.MiddlewareFunc
DefaultMiddlewares returns default middlewares with Victoria Metrics compatible logging. The logger should be configured with JSONFormatter and FieldMap to use "_msg" field.
func VictoriaMetricsLogger ¶ added in v0.1.16
func VictoriaMetricsLogger(logger *logrus.Logger) echo.MiddlewareFunc
VictoriaMetricsLogger creates a middleware that logs HTTP requests using the provided logrus logger. The logger should be configured with JSONFormatter and FieldMap to use "_msg" field.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Middleware ¶
func (a *Auth) Middleware(next echo.HandlerFunc) echo.HandlerFunc
type Config ¶
type Config struct {
Host string `mapstructure:"host" json:"host,omitempty"`
Port int64 `mapstructure:"port" json:"port,omitempty"`
EncryptionSecret string `mapstructure:"encryption_secret" json:"encryption_secret,omitempty"`
TaskQueueName string `mapstructure:"task_queue_name" json:"task_queue_name,omitempty"`
}
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
func NewErrorResponse ¶
func NewErrorResponse(message string) ErrorResponse
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( cfg Config, policy policy.Service, redis *redis.Redis, vaultStorage vault.Storage, client *asynq.Client, inspector *asynq.Inspector, spec plugin.Spec, middlewares []echo.MiddlewareFunc, metrics metrics.PluginServerMetrics, logger *logrus.Logger, safety safety.Storage, ) *Server
NewServer returns a new server.
func (*Server) SetAuthMiddleware ¶
func (s *Server) SetAuthMiddleware(auth echo.MiddlewareFunc)
func (*Server) VerifierAuthMiddleware ¶
func (s *Server) VerifierAuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Click to show internal directories.
Click to hide internal directories.