controller

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const NodeVersion = "0.5.6"

Variables

This section is empty.

Functions

func ApplyChunkedUserUpdate added in v0.5.3

func ApplyChunkedUserUpdate(ctx context.Context, back backend.Backend, users []*common.User) error

ApplyChunkedUserUpdate applies chunked user payloads as targeted deltas. Full replacement sync is handled by SyncUsers; this path must not restart the core for large queued user updates.

func BuildUsersFromChunks added in v0.2.0

func BuildUsersFromChunks(chunks map[uint64][]*common.User, lastIndex uint64, sawLast bool) ([]*common.User, error)

BuildUsersFromChunks orders chunked user payloads by their index and returns a single slice.

Types

type Controller

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

Lock order: controlMu before mu. startMu is a leaf: it is never held while taking another lock or while a start runs.

func New

func New(cfg *config.Config) *Controller

func (*Controller) ApiKey

func (c *Controller) ApiKey() uuid.UUID

func (*Controller) Backend

func (c *Controller) Backend() backend.Backend

func (*Controller) BaseInfoResponse

func (c *Controller) BaseInfoResponse() *common.BaseInfoResponse

func (*Controller) Connect

func (c *Controller) Connect(keepAlive uint64)

func (*Controller) Disconnect

func (c *Controller) Disconnect()

Disconnect stops the backend. It first aborts a start in progress, which would otherwise hold mu until the core is up: process shutdown calls Disconnect without LockControl.

func (*Controller) LastRequest added in v0.5.5

func (c *Controller) LastRequest() time.Time

func (*Controller) LockControl added in v0.5.3

func (c *Controller) LockControl()

func (*Controller) NewRequest

func (c *Controller) NewRequest()

func (*Controller) OutboundsLatency added in v0.4.1

func (c *Controller) OutboundsLatency(ctx context.Context, request *common.LatencyRequest) (*common.LatencyResponse, error)

func (*Controller) StartBackend

func (c *Controller) StartBackend(ctx context.Context, backend *common.Backend) error

func (*Controller) StartOrAttach added in v0.5.5

func (c *Controller) StartOrAttach(ctx context.Context, data *common.Backend) error

StartOrAttach starts the core, or refreshes keep-alive if the same core is already running (heartbeat case). It only restarts when:

  • No backend is running, or
  • The running backend has stopped or fails its health check, or
  • The incoming config differs from what started the current backend, and the backend cannot apply the difference live.

The start runs to the end even when the caller goes away, so a timed-out Start leaves a running core for the next Start or attach; Disconnect still aborts it.

Caller must hold LockControl.

func (*Controller) SystemStats

func (c *Controller) SystemStats(ctx context.Context) *common.SystemStatsResponse

func (*Controller) UnlockControl added in v0.5.3

func (c *Controller) UnlockControl()

type Service

type Service interface {
	Disconnect()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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