Documentation
¶
Overview ¶
Package config handles the persistent daemon configuration stored in ~/.gsd-cloud/config.json.
Index ¶
- Constants
- func NewInstallationID() (string, error)
- func Path() (string, error)
- func Save(cfg *Config) error
- type Config
- func (c *Config) EffectiveMaxConcurrentTasks() int
- func (c *Config) EffectiveTaskTimeout() time.Duration
- func (c *Config) EffectiveWarmWorkerIdle() time.Duration
- func (c *Config) EffectiveWarmWorkerIdleCap() int
- func (c *Config) EffectiveWarmWorkersEnabled() bool
- func (cfg *Config) EnsureInstallationID() (string, error)
Constants ¶
View Source
const DefaultLogLevel = "info"
DefaultLogLevel is the default slog level string.
View Source
const DefaultRelayURL = "wss://relay.gsd.build/ws/daemon"
DefaultRelayURL is the production relay WebSocket endpoint.
View Source
const DefaultServerURL = "https://app.gsd.build"
DefaultServerURL is the production web app host.
View Source
const DefaultTaskTimeoutMinutes = 30
DefaultTaskTimeoutMinutes is the default per-task timeout.
View Source
const DefaultWarmWorkerIdleCap = 4
View Source
const DefaultWarmWorkerIdleMinutes = 20
View Source
const MaxWarmWorkerIdleCap = 16
View Source
const MaxWarmWorkerIdleMinutes = 60
View Source
const MinWarmWorkerIdleCap = 0
View Source
const MinWarmWorkerIdleMinutes = 2
Variables ¶
This section is empty.
Functions ¶
func NewInstallationID ¶
Types ¶
type Config ¶
type Config struct {
MachineID string `json:"machineId"`
InstallationID string `json:"installationId,omitempty"`
AuthToken string `json:"authToken"`
TokenExpiresAt string `json:"tokenExpiresAt,omitempty"`
ServerURL string `json:"serverUrl"`
RelayURL string `json:"relayUrl"`
MaxConcurrentTasks int `json:"maxConcurrentTasks,omitempty"` // 0 means runtime.NumCPU
TaskTimeoutMinutes int `json:"taskTimeoutMinutes,omitempty"`
WarmWorkersEnabled *bool `json:"warmWorkersEnabled,omitempty"`
WarmWorkerIdleMinutes int `json:"warmWorkerIdleMinutes,omitempty"`
WarmWorkerIdleCap *int `json:"warmWorkerIdleCap,omitempty"`
LogLevel string `json:"logLevel,omitempty"`
}
Config is the on-disk daemon state.
func (*Config) EffectiveMaxConcurrentTasks ¶
EffectiveMaxConcurrentTasks returns the configured limit or runtime.NumCPU() when the field is 0 (unset).
func (*Config) EffectiveTaskTimeout ¶
EffectiveTaskTimeout returns the configured timeout duration or the 30-minute default when the field is 0 (unset).
func (*Config) EffectiveWarmWorkerIdle ¶
func (*Config) EffectiveWarmWorkerIdleCap ¶
func (*Config) EffectiveWarmWorkersEnabled ¶
func (*Config) EnsureInstallationID ¶
Click to show internal directories.
Click to hide internal directories.