Documentation
¶
Overview ¶
Package system implements the daemon's system service: sync, install/upgrade, registration, and health. It owns the WebSocket connection to base, periodic pulls and state updates, and local task result handling with deduplication. Internal-only; external code should use pkg/core/system.
Index ¶
- func WSConnected() bool
- func WSLastConnect() (t time.Time)
- func WSLastError() *string
- func WSReconnectsSinceStart() uint64
- type AccessTokenProvider
- type AgentStatus
- type AgentUpdateV1
- type DefaultService
- func (s *DefaultService) GetInfo(ctx context.Context) (utils.SystemInfo, error)
- func (s *DefaultService) GetMode(ctx context.Context) (system.ModeStatus, error)
- func (s *DefaultService) GetTasks(ctx context.Context, status string) (system.TaskSummary, error)
- func (s *DefaultService) Install(ctx context.Context, version string) (string, error)
- func (s *DefaultService) IsRegistered(ctx context.Context) (system.RegistrationStatus, error)
- func (s *DefaultService) RegisterInstance(ctx context.Context, req system.RegisterInstanceRequest) error
- func (s *DefaultService) RequestDomain(ctx context.Context, req system.RequestDomainRequest) (string, error)
- func (s *DefaultService) RunDoctor(ctx context.Context) (string, error)
- func (s *DefaultService) SetMode(ctx context.Context, req system.SetModeRequest) (system.ModeStatus, error)
- func (s *DefaultService) SystemStatus(ctx context.Context) (system.SystemStatus, error)
- func (s *DefaultService) UpdateBootstrapToken(ctx context.Context, req system.UpdateBootstrapTokenRequest) error
- type Executor
- type HelloAckV1
- type HelloV1
- type Metrics
- type PlatformInfo
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WSConnected ¶
func WSConnected() bool
func WSLastConnect ¶
func WSLastError ¶
func WSLastError() *string
func WSReconnectsSinceStart ¶
func WSReconnectsSinceStart() uint64
Types ¶
type AccessTokenProvider ¶
AccessTokenProvider provides the current agent access token.
type AgentStatus ¶
type AgentUpdateV1 ¶
type AgentUpdateV1 struct {
Schema string `json:"schema"`
Seq uint64 `json:"seq"`
Epoch string `json:"epoch"`
Full bool `json:"full"`
InstanceID string `json:"instance_id"`
AgentVersion string `json:"agent_version"`
Platform PlatformInfo `json:"platform"`
Status *AgentStatus `json:"status,omitempty"`
}
type DefaultService ¶
type DefaultService struct {
// contains filtered or unexported fields
}
func NewDefaultService ¶
func NewDefaultService(cfg *shared.Config, store store.InstanceStore, results store.TaskResultStore) *DefaultService
func (*DefaultService) GetInfo ¶
func (s *DefaultService) GetInfo(ctx context.Context) (utils.SystemInfo, error)
func (*DefaultService) GetMode ¶
func (s *DefaultService) GetMode(ctx context.Context) (system.ModeStatus, error)
GetMode returns the current daemon mode.
func (*DefaultService) GetTasks ¶
func (s *DefaultService) GetTasks(ctx context.Context, status string) (system.TaskSummary, error)
func (*DefaultService) IsRegistered ¶
func (s *DefaultService) IsRegistered(ctx context.Context) (system.RegistrationStatus, error)
func (*DefaultService) RegisterInstance ¶
func (s *DefaultService) RegisterInstance(ctx context.Context, req system.RegisterInstanceRequest) error
func (*DefaultService) RequestDomain ¶
func (s *DefaultService) RequestDomain(ctx context.Context, req system.RequestDomainRequest) (string, error)
During the installation process, this method is used to register the instance with the base, used for routing traffic to this instance instead of directly hitting it. This is to ensure HTTPS traffic is enforced on dployr instance. Please refer to the documentation at https://docs.dployr.dev/installation for more details.
func (*DefaultService) RunDoctor ¶
func (s *DefaultService) RunDoctor(ctx context.Context) (string, error)
func (*DefaultService) SetMode ¶
func (s *DefaultService) SetMode(ctx context.Context, req system.SetModeRequest) (system.ModeStatus, error)
SetMode updates the daemon mode.
func (*DefaultService) SystemStatus ¶
func (s *DefaultService) SystemStatus(ctx context.Context) (system.SystemStatus, error)
func (*DefaultService) UpdateBootstrapToken ¶
func (s *DefaultService) UpdateBootstrapToken(ctx context.Context, req system.UpdateBootstrapTokenRequest) error
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs tasks by routing them through existing HTTP handlers.
func NewExecutor ¶
NewExecutor creates a task executor that uses the web server's routes.
type HelloAckV1 ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(cfg *shared.Config, inst store.InstanceStore, results store.TaskResultStore) *Metrics