Versions in this module Expand all Collapse all v0 v0.0.2 Jun 16, 2026 v0.0.1 Jun 12, 2026 Changes in this version + const Version + var DefaultCachePath = platformDefaultCachePath + var DefaultConfigPath = platformDefaultConfigPath + var ErrFactNotFound = errors.New("fact not found") + var ErrNullByte = errors.New("external fact contains a null byte reference") + var ErrUnknownOS = errors.New("unknown os") + var NativeDefaultConfigPath = platformNativeDefaultConfigPath + func BlocklistedFacts(entries []string) map[string]bool + func BlocklistedFactsForFiltering(entries []string, configured []FactGroup) map[string]bool + func BlocklistedFactsWithGroups(entries []string, configured []FactGroup) map[string]bool + func Collection(facts []ResolvedFact) map[string]any + func CollectionWithDottedFacts(facts []ResolvedFact, includeTypedDotted bool) map[string]any + func ConfigBlocklist(path string) ([]string, error) + func ConstructOSHierarchy(hierarchy []any, searchedOS string) []string + func CurrentDefaultExternalFactDirs() []string + func CustomValueContainsNullByte(value any) bool + func DefaultExternalFactDirs(windows, root bool, home, windowsDataDir string) []string + func DetectOSHierarchy(hierarchy []any, identifier, family string) []string + func DetectOSIdentifier(hostOS, linuxDistroID string) (string, error) + func ExternalFactResolutionRunning() bool + func FactGroupName(groups []FactGroup, fact string) (string, bool) + func FormatFactGroups(groups []FactGroup) string + func FormatHOCON(facts []ResolvedFact) string + func FormatHOCONWithDottedFacts(facts []ResolvedFact, includeTypedDotted bool) string + func FormatJSON(facts []ResolvedFact) (string, error) + func FormatJSONWithDottedFacts(facts []ResolvedFact, includeTypedDotted bool) (string, error) + func FormatLegacy(facts []ResolvedFact) string + func FormatLegacyColored(facts []ResolvedFact, includeTypedDotted, colorize bool) string + func FormatLegacyWithDottedFacts(facts []ResolvedFact, includeTypedDotted bool) string + func FormatYAML(facts []ResolvedFact) string + func FormatYAMLWithDottedFacts(facts []ResolvedFact, includeTypedDotted bool) string + func GroupTTLSeconds(ttls []FactTTL, fact string) (int64, bool) + func NormalizeCustomValue(value any) any + func PuppetPluginFactDirs() []string + func SetDebugHandler(handler func(string)) + func SetErrorHandler(handler func(string)) + func SetWarningHandler(handler func(string)) + func ValueForQuery(fact ResolvedFact) any + func WarnPuppetRubyPluginFacts() + type ConfigOptions struct + Debug bool + ExternalDirs []string + ForceDotResolution bool + LogLevel string + NoExternalFacts bool + Sequential bool + SequentialSet bool + Verbose bool + func ConfigFileOptions(path string) (ConfigOptions, error) + type Engine struct + func NewEngine(cfg EngineConfig) (*Engine, error) + func (e *Engine) Discover(ctx context.Context, queries ...string) (*Snapshot, error) + type EngineConfig struct + BlockedFacts map[string]bool + CLICompat bool + ConfigFile string + ExternalDirs []string + Facts []ProgrammaticFact + Logger *slog.Logger + NoExternalFacts bool + Puppet bool + SystemDefaults bool + UseCache bool + type FactCache struct + func NewFactCache(dir string, ttls []FactTTL, groups []FactGroup) *FactCache + func (fc *FactCache) CacheFacts(facts []ResolvedFact) error + func (fc *FactCache) ResolveFacts(searched []ResolvedFact) ([]ResolvedFact, []ResolvedFact) + type FactGroup struct + Facts []string + Name string + func BuiltinFactGroups() []FactGroup + func ConfigFactGroups(path string) ([]FactGroup, error) + func ExternalFactGroups(dirs []string) ([]FactGroup, error) + func MergeFactGroups(defaults, configured []FactGroup) []FactGroup + type FactTTL struct + Fact string + TTL string + func ConfigTTLs(path string) ([]FactTTL, error) + type FormatOptions struct + HOCON bool + JSON bool + YAML bool + type Formatter interface + Format func([]ResolvedFact) (string, error) + Name func() string + func BuildFormatter(opts FormatOptions) Formatter + type ProgrammaticFact struct + Name string + Resolve func(ctx context.Context) (any, error) + type ResolvedFact struct + File string + Name string + Type string + UserQuery string + Value any + func CoreFacts(s *Session) []ResolvedFact + func CoreFactsWithRuby(s *Session, includeRuby bool) []ResolvedFact + func FilterBlockedFacts(facts []ResolvedFact, blocked map[string]bool) []ResolvedFact + func LoadExternalFacts(s *Session, dirs []string) ([]ResolvedFact, error) + func LoadExternalFactsFromDirs(s *Session, dirs []string, blocked map[string]bool) ([]ResolvedFact, error) + func LoadExternalFactsWithBlocklist(s *Session, dirs []string, blocked map[string]bool) ([]ResolvedFact, error) + func PuppetFacts() []ResolvedFact + func Select(facts []ResolvedFact, queries []string) []ResolvedFact + func SelectWithDottedFacts(facts []ResolvedFact, queries []string, includeTypedDotted bool) []ResolvedFact + type Session struct + func NewSession() *Session + func NewSessionContext(ctx context.Context) *Session + func (s *Session) ClearCoreFacts() + func (s *Session) Context() context.Context + type Snapshot struct + func (sn *Snapshot) All() iter.Seq2[string, any] + func (sn *Snapshot) Facts() []ResolvedFact + func (sn *Snapshot) Tree() map[string]any + func (sn *Snapshot) Value(query string) (any, error)