Documentation ¶
Index ¶
- type Config
- type ConfigValues
- func (cv ConfigValues) Exists(config string, exact bool) bool
- func (cv ConfigValues) GetInt32Value(config string, def int32) int32
- func (cv ConfigValues) GetInt32Values(config string, def []int32) []int32
- func (cv ConfigValues) GetIntValue(config string, def int) int
- func (cv ConfigValues) GetIntValues(config string, def []int) []int
- func (cv ConfigValues) GetStringValue(config string, def string) string
- func (cv ConfigValues) GetStringValues(config string, def []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config map[string]ConfigValues
func (Config) Interface ¶
func (cfg Config) Interface(name string) (ConfigValues, error)
Interface returns the configuration of a specific interface. If the interface is not found, an error is returned.
func (Config) Interfaces ¶
func (cfg Config) Interfaces() map[string]ConfigValues
Interfaces return a map of interfaces and their configuration. If there are no interfaces, an empty map is returned. An interface starts with the "interface" prefix.
func (Config) Vlan ¶
func (cfg Config) Vlan(id int32) (ConfigValues, error)
Vlan returns the configuration of a specific VLAN. If the VLAN is not found, an error is returned.
func (Config) VlanIDs ¶
VlanIDs returns a list of all VLAN IDs, specified in the config. The list is sorted.
func (Config) Vlans ¶
func (cfg Config) Vlans() map[int32]ConfigValues
Vlans list all VLANs and their ids. The VLANs are taken from the config command.
type ConfigValues ¶
type ConfigValues []string
func (ConfigValues) Exists ¶
func (cv ConfigValues) Exists(config string, exact bool) bool
Exists checks if a config value exists
func (ConfigValues) GetInt32Value ¶
func (cv ConfigValues) GetInt32Value(config string, def int32) int32
func (ConfigValues) GetInt32Values ¶
func (cv ConfigValues) GetInt32Values(config string, def []int32) []int32
func (ConfigValues) GetIntValue ¶
func (cv ConfigValues) GetIntValue(config string, def int) int
func (ConfigValues) GetIntValues ¶
func (cv ConfigValues) GetIntValues(config string, def []int) []int
func (ConfigValues) GetStringValue ¶
func (cv ConfigValues) GetStringValue(config string, def string) string
func (ConfigValues) GetStringValues ¶
func (cv ConfigValues) GetStringValues(config string, def []string) []string
Click to show internal directories.
Click to hide internal directories.