controller

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ConnPollTime = 1 * time.Second
View Source
const LogBatchSize = 100
View Source
const MaxInternalLog = 100
View Source
const TransportPeerBufferSize = 100
View Source
const WriteDeadline = 10 * time.Second // this is very high, just helps to clear out hung connections, not for real flow control

Variables

View Source
var TransportDroppedPackets int64
View Source
var TransportPacketsQueued int64

Global counters for transport statistics

Functions

This section is empty.

Types

type ControllerImpl

type ControllerImpl struct {
	Lock sync.Mutex // lock for this struct

	AppInfo             ds.AppInfo             // combined application information
	OutrigForceDisabled bool                   // whether outrig is force disabled
	InternalLogBuf      *utilds.CirBuf[string] // internal log for debugging
	// contains filtered or unexported fields
}

func MakeController

func MakeController(appName string, cfg config.Config) (*ControllerImpl, error)

this is idempotent

func (*ControllerImpl) Disable

func (c *ControllerImpl) Disable(disconnect bool)

func (*ControllerImpl) Enable

func (c *ControllerImpl) Enable()

func (*ControllerImpl) GetAppRunId

func (c *ControllerImpl) GetAppRunId() string

func (*ControllerImpl) GetConfig

func (c *ControllerImpl) GetConfig() config.Config

func (*ControllerImpl) ILog added in v0.1.9

func (c *ControllerImpl) ILog(format string, args ...any)

func (*ControllerImpl) InitialStart added in v0.1.9

func (c *ControllerImpl) InitialStart()

func (*ControllerImpl) IsForceDisabled

func (c *ControllerImpl) IsForceDisabled() bool

func (*ControllerImpl) SendPacket

func (c *ControllerImpl) SendPacket(pk *ds.PacketType) (bool, error)

func (*ControllerImpl) Shutdown

func (c *ControllerImpl) Shutdown()

func (*ControllerImpl) WriteInitMessage added in v0.2.2

func (c *ControllerImpl) WriteInitMessage(connected bool, connWrap *comm.ConnWrap, permErr error, transErr error)

type Transport added in v0.5.0

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

Transport handles connection management and packet sending functionality

func MakeTransport added in v0.5.0

func MakeTransport(cfg *config.Config) *Transport

MakeTransport creates a new Transport instance

func (*Transport) AddConn added in v0.5.0

func (t *Transport) AddConn(conn *comm.ConnWrap)

AddConn adds a connection to the connection map

func (*Transport) CloseAllConns added in v0.5.0

func (t *Transport) CloseAllConns()

CloseAllConns closes all connections

func (*Transport) HasConnections added in v0.5.0

func (t *Transport) HasConnections() bool

IsConnected returns true if there are any active connections

func (*Transport) SendPacket added in v0.5.0

func (t *Transport) SendPacket(pk *ds.PacketType, force bool) (bool, error)

SendPacket sends a packet if Outrig is enabled

Jump to

Keyboard shortcuts

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