Documentation ¶
Index ¶
- func GetFact(fact string, file string, log Logger) ([]byte, gjson.Result, error)
- func GetFactJSON(fact string, facts json.RawMessage) (gjson.Result, error)
- func HasFact(fact string, operator string, value string, file string, log Logger) (bool, error)
- func HasFactJSON(fact string, operator string, value string, facts json.RawMessage, log Logger) (bool, error)
- func JSON(file string, log Logger) (json.RawMessage, error)
- func MatchFacts(filters [][3]string, facts json.RawMessage, log Logger) bool
- func MatchFile(filters [][3]string, file string, log Logger) bool
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFact ¶
GetFact looks up a single fact from the facts file, errors reading the file is reported but an absent fact is handled as empty result and no error
func GetFactJSON ¶
GetFactJSON looks up a single fact from the JSON data, absent fact is handled as empty result and no error
func HasFactJSON ¶
func JSON ¶
func JSON(file string, log Logger) (json.RawMessage, error)
JSON parses the data, including doing any conversions needed, and returns JSON text
func MatchFacts ¶
func MatchFacts(filters [][3]string, facts json.RawMessage, log Logger) bool
MatchFacts match fact filters in a OR manner, only facts matching all filters will be true
Types ¶
Click to show internal directories.
Click to hide internal directories.