panel

package
v0.0.0-...-988fc5f Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStaticRuntimeConfigEmptyNodes = errors.New("static mode requires at least one Nodes entry")
	ErrRuntimeConfigModeConflict     = errors.New("static Nodes and enabled MachineConfig are mutually exclusive")
	ErrRuntimeConfigModeChange       = errors.New("online runtime mode change is not supported")
)
View Source
var ErrRemotePanelRequiresHTTPS = errors.New("remote panel API host must use HTTPS")

Functions

func ValidateRuntimeConfig

func ValidateRuntimeConfig(config *Config) error

func ValidateRuntimeConfigReload

func ValidateRuntimeConfigReload(current, candidate *Config) error

Types

type Config

type Config struct {
	LogConfig          *LogConfig           `mapstructure:"Log"`
	DnsConfigPath      string               `mapstructure:"DnsConfigPath"`
	InboundConfigPath  string               `mapstructure:"InboundConfigPath"`
	OutboundConfigPath string               `mapstructure:"OutboundConfigPath"`
	RouteConfigPath    string               `mapstructure:"RouteConfigPath"`
	ConnectionConfig   *ConnectionConfig    `mapstructure:"ConnectionConfig"`
	Observability      *ObservabilityConfig `mapstructure:"Observability"`
	MachineConfig      *MachineConfig       `mapstructure:"MachineConfig"`
	NodesConfig        []*NodesConfig       `mapstructure:"Nodes"`
}

func (*Config) ShowErrorDetails

func (c *Config) ShowErrorDetails() bool

type ConnectionConfig

type ConnectionConfig struct {
	Handshake    uint32 `mapstructure:"handshake"`
	ConnIdle     uint32 `mapstructure:"connIdle"`
	UplinkOnly   uint32 `mapstructure:"uplinkOnly"`
	DownlinkOnly uint32 `mapstructure:"downlinkOnly"`
	BufferSize   int32  `mapstructure:"bufferSize"`
}

type LogConfig

type LogConfig struct {
	Level            string `mapstructure:"Level"`
	AccessPath       string `mapstructure:"AccessPath"`
	ErrorPath        string `mapstructure:"ErrorPath"`
	ShowErrorDetails bool   `mapstructure:"ShowErrorDetails"`
}

type MachineConfig

type MachineConfig struct {
	Enable            bool               `mapstructure:"Enable"`
	PanelType         string             `mapstructure:"PanelType"`
	ApiHost           string             `mapstructure:"ApiHost"`
	MachineID         int                `mapstructure:"MachineID"`
	Token             string             `mapstructure:"Token"`
	Timeout           int                `mapstructure:"Timeout"`
	DiscoveryInterval int                `mapstructure:"DiscoveryInterval"`
	ControllerConfig  *controller.Config `mapstructure:"ControllerConfig"`
}

type NodesConfig

type NodesConfig struct {
	PanelType        string             `mapstructure:"PanelType"`
	ApiConfig        *api.Config        `mapstructure:"ApiConfig"`
	ControllerConfig *controller.Config `mapstructure:"ControllerConfig"`
}

type ObservabilityConfig

type ObservabilityConfig struct {
	Enable              bool   `mapstructure:"Enable"`
	Listen              string `mapstructure:"Listen"`
	ReadinessStaleAfter int    `mapstructure:"ReadinessStaleAfter"`
}

type Panel

type Panel struct {

	// Server is a compatibility projection of the currently owned core.
	//
	// Deprecated: Use ServerInstance. The returned core is borrowed; callers
	// must not close it or assume ownership.
	Server *core.Instance
	// Service is a compatibility projection of the currently owned services.
	//
	// Deprecated: Use ServicesSnapshot, which returns a cloned slice.
	Service []service.Service
	// Running is a compatibility projection of the panel lifecycle.
	//
	// Deprecated: Use IsRunning.
	Running bool
	// contains filtered or unexported fields
}

Panel Structure

func New

func New(panelConfig *Config) *Panel

func (*Panel) Close

func (p *Panel) Close() error

Close the panel

func (*Panel) CloseContext

func (p *Panel) CloseContext(parent context.Context) error

func (*Panel) IsRunning

func (p *Panel) IsRunning() bool

IsRunning reports whether the authoritative panel lifecycle is running.

func (*Panel) ObservabilitySnapshot

func (p *Panel) ObservabilitySnapshot() service.RuntimeSnapshot

func (*Panel) ServerInstance

func (p *Panel) ServerInstance() *core.Instance

ServerInstance returns the core currently owned by the panel, if any. The returned core is borrowed; callers must not close it or assume ownership.

func (*Panel) ServicesSnapshot

func (p *Panel) ServicesSnapshot() []service.Service

ServicesSnapshot returns a cloned slice of services currently owned by the panel. The service references are borrowed and must not be closed by callers.

func (*Panel) Start

func (p *Panel) Start() error

Start the panel

func (*Panel) StartContext

func (p *Panel) StartContext(parent context.Context) error

Jump to

Keyboard shortcuts

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