Documentation
¶
Overview ¶
Package profile is the server profile: one switch that sets which optional subsystems start.
Index ¶
- Constants
- func ActiveSource() string
- func Blocked(ps []Problem) bool
- func LazyStartInterval(lookup func(string) (string, bool)) time.Duration
- func Lookup(base func(string) (string, bool), p Profile) func(string) (string, bool)
- func LowRAMBytes(lookup func(string) (string, bool)) int64
- func NeedsConfirm(ps []Problem) bool
- func Retention(p Profile, diskBytes int64, lookup func(string) (string, bool)) time.Duration
- func SetActive(p Profile, src string)
- type Facts
- type Problem
- type Profile
- type Settings
Constants ¶
const ( GuardNodesEnrolled = "nodes_enrolled" GuardPluginsRunning = "plugins_running" GuardRetentionShorter = "retention_shorter" )
Guard codes returned by Check.
const ( SourceEnv = "env" SourceSetting = "setting" SourceDefault = "default" )
Where the effective profile came from.
const ( EnvSmallDiskBytes = "APP_SMALL_DISK_BYTES" EnvSmallDiskRetention = "APP_SMALL_DISK_RETENTION" EnvMinimalRetention = "APP_PROFILE_MINIMAL_RETENTION" EnvLowRAMBytes = "APP_LOW_RAM_BYTES" EnvLazyStartInterval = "APP_PROFILE_LAZY_START_INTERVAL" )
Env knobs for the profile thresholds.
const EnvVar = "APP_SERVER_PROFILE"
EnvVar pins the profile and wins over the saved choice. APP_PROFILE already names the CLI credentials profile, so the server uses its own variable.
Variables ¶
This section is empty.
Functions ¶
func ActiveSource ¶
func ActiveSource() string
ActiveSource says where the active profile came from.
func LazyStartInterval ¶
LazyStartInterval is how often a lazily started loop checks whether work appeared.
func LowRAMBytes ¶
LowRAMBytes is the memory below which an installer recommends the minimal profile.
func NeedsConfirm ¶
NeedsConfirm reports whether the move is allowed only with confirm set.
Types ¶
type Facts ¶
type Facts struct {
RemoteNodes int
EnabledPlugins int
// MeshStops is true when the move turns the effective mesh from on to off.
MeshStops bool
// Retention is the retention in force now, NewRetention the one the target profile would use.
Retention time.Duration
NewRetention time.Duration
}
Facts is the live state a move is checked against.
type Problem ¶
type Problem struct {
Code string `json:"code"`
Message string `json:"message"`
Blocking bool `json:"blocking"`
}
Problem is one reason a move needs attention. Blocking problems refuse the move; the rest need an explicit confirm because the next sweep deletes rows.
type Profile ¶
type Profile string
Profile names a bundle of defaults for optional subsystems.
type Settings ¶
type Settings struct {
Mesh bool
Features []experimental.Feature
LazyLoops bool
LoopbackAgent bool
Recommendations bool
MinRAMBytes int64
MinCPUCount int
// EnvDefaults are read as if set in the environment when the real variable is unset.
EnvDefaults map[string]string
}
Settings is what a profile turns on or off by default.