http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLogMiddleware

func AccessLogMiddleware(log *logrus.Logger) fiber.Handler

func ForceHTTPS

func ForceHTTPS(httpsPort string) fiber.Handler

func NewHandler

func NewHandler(logger logrus.FieldLogger) *fiber.App

func SSHWebsocket

func SSHWebsocket(c *websocket.Conn)

ws://host/ws/ssh?host=192.168.1.10&port=22&user=root&token=xxx

Types

type Config

type Config struct {
	HTTPAddress  string
	HTTPSAddress string
	HTTPSDisable bool
}

HTTPServerConfig:单个 httpserver 实例的配置 HTTPServerConfig: configuration for a single httpserver instance.

type HTTPServerInstance

type HTTPServerInstance struct {
	api.Server

	//Conf         *config.Config
	AccessLogger *logrus.Logger
	// contains filtered or unexported fields
}

HTTPServerInstance:具体实例,实现 pluginapi.Instance HTTPServerInstance: concrete instance implementing pluginapi.Instance.

func New

func New(cfg Config) *HTTPServerInstance

New:根据配置创建实例(不启动服务,Init 时才启动) New: create an instance from config (server starts in Init).

func (*HTTPServerInstance) Close

func (s *HTTPServerInstance) Close() error

Close:取消实例 ctx,等待所有协程退出 Close: cancel instance ctx and wait for all goroutines to exit.

func (*HTTPServerInstance) Init

func (s *HTTPServerInstance) Init(parent context.Context, cycle *core.Cycle) error

Init:使用 parent ctx + HostEnv 初始化实例,并启动 HTTP 服务 Init: initialize instance with parent ctx + HostEnv, and start HTTP server.

Jump to

Keyboard shortcuts

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