server

package
v0.1.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 35 Imported by: 2

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 NewAuth

func NewAuth(token string) *Auth

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) GetRouter added in v0.1.16

func (s *Server) GetRouter() *echo.Echo

func (*Server) SetAuthMiddleware

func (s *Server) SetAuthMiddleware(auth echo.MiddlewareFunc)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) VerifierAuthMiddleware

func (s *Server) VerifierAuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc

type SkillsResponse added in v0.1.20

type SkillsResponse struct {
	PluginID string `json:"plugin_id"`
	SkillsMD string `json:"skills_md"`
}

SkillsResponse represents the response for the /skills endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL