{"modulePath":"github.com/CoreC-Dev/CoreC","version":"v0.0.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\nPackage executor applies configuration changes to the running engine via diff-and-apply, minimizing disruption to active data flows.\n\n## Functions\n\n```go\nfunc ApplyConfig(cfg *core.Config, force bool) error\n```\nApplyConfig applies configuration diffs to the running engine.\n\n```go\nfunc CurrentConfig() *core.Config\n```\nCurrentConfig returns the current active configuration.\n\n```go\nfunc Init(e core.Engine, initialCfg *core.Config, path string)\n```\nInit initializes the executor with the active engine, config, and file path.\n\n```go\nfunc ParseWithBytes(buf []byte) (*core.Config, error)\n```\nParseWithBytes parses configuration from YAML bytes WITHOUT validating. See ParseWithPath for why validation is deferred.\n\n```go\nfunc ParseWithPath(path string) (*core.Config, error)\n```\nParseWithPath parses configuration from a file path WITHOUT validating. The executor's Reload path calls this so it can run the sentinel-merge (config.MergeSentinels) before validation — validate rejects the \"\\*\\*\\*\" sentinel for short secret fields, so the merge must restore real values first.\n\n```go\nfunc Patch(patch map[string]any) error\n```\n\n```go\nfunc RawConfigYAML() (string, error)\n```\nRawConfigYAML returns the full active configuration as YAML text with every secret value redacted to the SentinelValue (\"\\*\\*\\*\"). Used by GET /configs/raw so the Dashboard's Config Center can populate its editor with the server's real config without exposing credentials to the operator's browser.\n\nThe redacted config is safe to round-trip: when submitted back via PUT /configs, the executor's sentinel-merge (in Reload) restores the real secret values before ApplyConfig persists the config.\n\n```go\nfunc Reload(path, payload string) error\n```\nReload executes a full configuration reload either from a file or payload string.\n\n```go\nfunc Validate(payload string) (warnings []string, err error)\n```\nValidate performs a dry-run validation of a config payload WITHOUT applying it. It parses the payload, runs the sentinel-merge against the live config (so \"\\*\\*\\*\" placeholders for unchanged secrets are restored to real values), THEN validates — producing a faithful prediction of whether Reload would accept the config. Used by POST /configs/validate so the Dashboard can surface errors before the operator commits a PUT /configs.\n\nThe merge is essential here: validate enforces api.secret minimum length and would reject the 3-char \"\\*\\*\\*\" sentinel before the real value is restored. Merging first makes the dry-run match the real Reload outcome (which also merges before validating).\n\n","path":"github.com/CoreC-Dev/CoreC/hub/executor","name":"executor","synopsis":"Package executor applies configuration changes to the running engine via diff-and-apply, minimizing disruption to active data flows.","isRedistributable":true}
