Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteConfig ¶
func WriteConfig(outputFile string, configData *HostsConfig) error
WriteConfig saves a HostsConfig to a file
Types ¶
type Host ¶
type Host struct { Current string `json:"current,omitempty"` Options map[string]string `json:"options,omitempty"` }
Host defines the data associated with a hostname
type HostsConfig ¶
type HostsConfig struct { LocalHostnames []string `json:"localHostnames,omitempty"` IPv6Defaults bool `json:"ipV6Defaults,omitempty"` Hosts map[string]Host `json:"hosts,omitempty"` GlobalIPs map[string]string `json:"globalIPs,omitempty"` Groups map[string][]string `json:"groups,omitempty"` }
HostsConfig defines the structure of the hosts config file
func BuildConfigFromHosts ¶
func BuildConfigFromHosts(hosts map[string][]string) *HostsConfig
BuildConfigFromHosts builds a config from a map of hostnames to ips
func LoadConfigFromFile ¶
func LoadConfigFromFile(fileName string) (*HostsConfig, error)
LoadConfigFromFile loads a HostsConfig from a file
Click to show internal directories.
Click to hide internal directories.