Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns ~/.config/hpcc/config.toml on Unix and the platform equivalent elsewhere.
func ParseSize ¶
ParseSize converts a human-readable size string (e.g. "10G", "500MB", "1.5GiB" — actually no, integer only — "1024K", "4096") into bytes. Suffixes are case-insensitive; whitespace between number and suffix is allowed. A plain number is bytes. An empty string returns 0, which the cache layer interprets as "unlimited."
All multipliers are binary (1024-based), including KB/MB/GB/TB. If you need strict-decimal SI semantics you'll have to ask for them separately; nobody asks the size of their RAM stick in base 10.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
Type enum.CacheType `toml:"type"`
// Disk-specific fields.
Location string `toml:"location,omitempty"`
MaxSize string `toml:"max_size,omitempty"`
// S3-specific fields.
Bucket string `toml:"bucket,omitempty"`
Region string `toml:"region,omitempty"`
Endpoint string `toml:"endpoint,omitempty"`
AccessKey string `toml:"access_key,omitempty"`
SecretKey string `toml:"secret_key,omitempty"`
// AutoCreate, when true, has the worker attempt CreateBucket if
// the bucket isn't reachable at startup. Only sane for local
// MinIO/dev setups — in production the bucket is provisioned by
// infra and the worker shouldn't even hold CreateBucket IAM
// permissions. Default false.
AutoCreate bool `toml:"auto_create,omitempty"`
}
CacheConfig describes a single cache backend. The Type field selects which backend is used; the remaining fields are type-specific (only the fields relevant to the chosen type need to be set).
TOML example (multiple caches):
[[cache]] type = "disk" location = "/tmp/hpcc" max_size = "10G" [[cache]] type = "disk" location = "/mnt/fast/hpcc" max_size = "50G"
type Config ¶
type Config struct {
// SourceMode picks both the local cache-key derivation and the
// dispatch wire format. The two have to track the same value so
// client and worker compute matching keys for shared caches —
// see enum.SourceMode for the full story.
SourceMode enum.SourceMode `toml:"source_mode"`
Caches []CacheConfig `toml:"cache"`
Remote RemoteConfig `toml:"remote"`
}
Config is the on-disk configuration shape. TOML keys are snake_case; Go fields use the standard tag.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the values used when no config file is present.
func LoadConfig ¶
LoadConfig reads a TOML config from path. A missing file is not an error — it returns DefaultConfig. A malformed file IS an error; the user should know their config is being ignored.
type RemoteConfig ¶
type RemoteConfig struct {
Enabled bool `toml:"enabled"`
TenantID string `toml:"tenant_id"`
ImageRef string `toml:"image_ref"`
ImageDigest string `toml:"image_digest"`
Scheduler SchedulerConfig `toml:"scheduler"`
}
RemoteConfig drives the daemon's distributed-compile path. When Enabled is false (the default) the daemon stays local. When true, each compile request is routed through the scheduler to a worker; failures fall back to local execution with a warning.
SourceMode lives on the parent Config, not here — it drives the local cache key too, not just dispatch, and a daemon with no [remote] block still needs a value for its cache key.
OAuth credentials are NOT in this struct: `hpcc auth login` writes them to a sibling token.json (0600). The daemon reads from there and refreshes silently when the access token expires.
type SchedulerConfig ¶
SchedulerConfig is the dial info for the scheduler gRPC endpoint. CAFile is optional — if empty, the system trust store is used.