Documentation ¶
Index ¶
- func GetAppName(vlan *Vlan, defaultname string) string
- func GetEPGName(vlan *Vlan) string
- func GetRangeFromString(input string) (low, high int, err error)
- func GetVLANString(input string) (vlans []int, err error)
- func GetVRFName(vlan *Vlan) string
- func IntArrayEquals(a []int, b []int) bool
- func SaveJsonToFile(fn string, o interface{}) error
- type Vlan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAppName ¶
GetAppName Return the name of the application
func GetRangeFromString ¶
GetRangeFromString parses a string with the syntax #-# and returns the two numbers.
func GetVLANString ¶
GetVLANString parses a line of comma-separated VLAN's in Cisco format 1,10,12-15,20 TODO: add support for whitespace in string
func IntArrayEquals ¶
IntArrayEquals support func to verify arrays source: https://stackoverflow.com/questions/18561219/comparing-arrays-in-go-language
func SaveJsonToFile ¶
SaveJsonToFile save a struct to file as JSON with readable formatting. Returned is the error, if any.
Types ¶
type Vlan ¶
type Vlan struct { ID int // VLAN ID Name string // name of VLAN Tenant string // tenant name VRF string // name of VRF Domain string // physical domain App string // Application associated with Vlan EPG string // EPG associated with Vlan }
Vlan is a struct that you can use to keep some information about a VLAN.
func FindVlan ¶
FindVlan Look through an array of VLANs and find first VLAN with an ID, return nil if not found
func FindVlanDomain ¶
FindVlanDomain Look through an array of Vlans to find a VLAN inside a domain
func MakeTestVlans ¶
func MakeTestVlans() []Vlan
MakeTestVlans this func just returns a list of VLANs that is used for testing code