Documentation
¶
Index ¶
- Constants
- func ApplyChunkedUserUpdate(ctx context.Context, back backend.Backend, users []*common.User) error
- func BuildUsersFromChunks(chunks map[uint64][]*common.User, lastIndex uint64, sawLast bool) ([]*common.User, error)
- type Controller
- func (c *Controller) ApiKey() uuid.UUID
- func (c *Controller) Backend() backend.Backend
- func (c *Controller) BaseInfoResponse() *common.BaseInfoResponse
- func (c *Controller) Connect(keepAlive uint64)
- func (c *Controller) Disconnect()
- func (c *Controller) LastRequest() time.Time
- func (c *Controller) LockControl()
- func (c *Controller) NewRequest()
- func (c *Controller) OutboundsLatency(ctx context.Context, request *common.LatencyRequest) (*common.LatencyResponse, error)
- func (c *Controller) StartBackend(ctx context.Context, backend *common.Backend) error
- func (c *Controller) StartOrAttach(ctx context.Context, data *common.Backend) error
- func (c *Controller) SystemStats(ctx context.Context) *common.SystemStatsResponse
- func (c *Controller) UnlockControl()
- type Service
Constants ¶
const NodeVersion = "0.5.5"
Variables ¶
This section is empty.
Functions ¶
func ApplyChunkedUserUpdate ¶ added in v0.5.3
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.
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 (*Controller) StartOrAttach ¶ added in v0.5.5
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()