admin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAndValidate added in v0.1.4

func DecodeAndValidate(w http.ResponseWriter, r *http.Request, v Validator) error

HTTP handler helper

func NewAdminAccessLogMiddleware

func NewAdminAccessLogMiddleware() middleware.Middleware

Types

type AdminAPI

type AdminAPI struct {
	// contains filtered or unexported fields
}

AdminAPI represents the administrative API for managing the load balancer.

func NewAdminAPI

func NewAdminAPI(
	manager *service.Manager,
	cfg *config.APIConfig,
	authService *auth_service.AuthService,
	logger *zap.Logger,
) *AdminAPI

NewAdminAPI creates a new instance of AdminAPI with the provided service manager and configuration. It initializes the HTTP mux and registers all API routes.

func (*AdminAPI) Handler

func (a *AdminAPI) Handler() http.Handler

Handler returns the HTTP handler for the AdminAPI, wrapped with necessary middleware.

type AdminAccessLogMiddleware

type AdminAccessLogMiddleware struct{}

func (*AdminAccessLogMiddleware) Middleware

func (m *AdminAccessLogMiddleware) Middleware(next http.Handler) http.Handler

type BackendRequest added in v0.1.4

type BackendRequest struct {
	URL            string                    `json:"url"`
	Weight         int                       `json:"weight"`
	MaxConnections int32                     `json:"maxConnections"`
	SkipTLSVerify  bool                      `json:"skipTLSVerify"`
	HealthCheck    *config.HealthCheckConfig `json:"healthCheck"`
}

func (BackendRequest) Validate added in v0.1.4

func (r BackendRequest) Validate() []ValidationError

type BackendStatus

type BackendStatus struct {
	URL         string `json:"url"`
	Alive       bool   `json:"alive"`
	Connections int32  `json:"connections"`
}

type ValidationError added in v0.1.4

type ValidationError struct {
	Field string
	Error string
}

func (ValidationError) String added in v0.1.4

func (e ValidationError) String() string

type Validator added in v0.1.4

type Validator interface {
	Validate() []ValidationError
}

Jump to

Keyboard shortcuts

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