Documentation ¶
Index ¶
Constants ¶
View Source
const DataSchema = "https://choria.io/schemas/choria/discovery/v1/inventory_file.json"
DataSchema the schema of supported inventory files
Variables ¶
This section is empty.
Functions ¶
func ValidateInventory ¶
Types ¶
type DataFile ¶
type DataFile struct { Schema string `json:"$schema" yaml:"$schema"` Groups []Group `json:"groups,omitempty" yaml:"groups,omitempty"` Nodes []Node `json:"nodes" yaml:"nodes"` }
DataFile is a source for discovery information that describes a fleet
func ReadInventory ¶
ReadInventory reads and validates an inventory file
type DiscoverOption ¶
type DiscoverOption func(o *dOpts)
DiscoverOption configures the broadcast discovery method
func Collective ¶
func Collective(c string) DiscoverOption
Collective sets the collective to discover in, else main collective is used
func DiscoveryOptions ¶
func DiscoveryOptions(opt map[string]string) DiscoverOption
DiscoveryOptions sets the key value pairs that make user supplied discovery options.
Supported options:
file - set the file to read
func Filter ¶
func Filter(f *protocol.Filter) DiscoverOption
Filter sets the filter to use for the discovery, else a blank one is used
type Group ¶
type Group struct { Name string `json:"name" yaml:"name"` Filter *GroupFilter `json:"filter,omitempty" yaml:"filter,omitempty"` }
Group is a view over the inventory expressed as a filter saved by name
type GroupFilter ¶
type GroupFilter struct { Agents []string `json:"agents,omitempty" yaml:"agents,omitempty"` Classes []string `json:"classes,omitempty" yaml:"classes,omitempty"` Facts []string `json:"facts,omitempty" yaml:"facts,omitempty"` Identities []string `json:"identities,omitempty" yaml:"identities,omitempty"` Compound string `json:"compound,omitempty" yaml:"compound,omitempty"` }
func (*GroupFilter) ToProtocolFilter ¶
func (f *GroupFilter) ToProtocolFilter() (*protocol.Filter, error)
type Node ¶
type Node struct { Name string `json:"name" yaml:"name"` Collectives []string `json:"collectives" yaml:"collectives"` Facts json.RawMessage `json:"facts" yaml:"facts"` Classes []string `json:"classes" yaml:"classes"` Agents []string `json:"agents" yaml:"agents"` }
Node describes a single node on the network
Click to show internal directories.
Click to hide internal directories.