control

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeConfig     = "configuration"
	CodeRoute      = "route"
	CodeConnect    = "connect"
	CodeDisconnect = "disconnect"
	CodeToken      = "token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address           string `json:"address,omitempty"`       // Address ( IPv4, IPv6, path or an abstract socket ) the control server should listen on
	Certificate       string `json:"certificate,omitempty"`   // Certificate file path
	Key               string `json:"key,omitempty"`           // Key file path
	LineLogBufferSize int    `json:"logBufferSize,omitempty"` // Turns line log buffering on when larger than 0, affects only service mode
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message,omitempty"`
}

type Result

type Result struct {
	Result any    `json:"result,omitempty"`
	Error  *Error `json:"error,omitempty"`
	Id     int    `json:"id,omitempty"`
}

func (Result) Json

func (r Result) Json() (j []byte)

type RingLog

type RingLog struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRingLog

func NewRingLog(lines int, tee io.Writer) (r *RingLog)

func (*RingLog) Dump

func (ringLog *RingLog) Dump() (b []byte)

func (*RingLog) Write

func (ringLog *RingLog) Write(b []byte) (n int, err error)

type Server

type Server struct {
	*Config
	// contains filtered or unexported fields
}

func New

func New(serverConfiguration ServerConfiguration) *Server

func (*Server) Init

func (s *Server) Init() (err error)

func (*Server) Serve

func (s *Server) Serve() (err error)

func (*Server) Shutdown

func (s *Server) Shutdown() error

type ServerConfiguration

type ServerConfiguration interface {
	GetConnectionConfiguration() *connection.Config
	GetControlConfiguration() *Config
	SaveJson() error
}

Jump to

Keyboard shortcuts

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