iosconfig

package
v0.0.0-...-95e1a72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]ConfigValues

func Parse

func Parse(config string) Config

Parse parses a Cisco IOS config and returns a Config object.

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

func (cfg Config) VlanIDs() []int32

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL