This Commit will introduce template support into the command
transcripts. This is done via the Golang text/template
library.
For example, in the packaged output of show_version.txt the hostname is listed as:
ROM: IOS-XE ROMMON
{{.Hostname}} uptime is 4 hours, 55 minutes
Uptime for this control processor is 4 hours, 56 minutes
Any value in the fakedevices.FakeDevice struct can be referenced in this way, today these are:
type FakeDevice struct {
Vendor string // Vendor of this fake device
Platform string // Platform of this fake device
Hostname string // Hostname of the fake device
Password string // Password of the fake device
SupportedCommands SupportedCommands // What commands this fake device supports
ContextSearch map[string]string // The available CLI prompt/contexts on this fake device
ContextHierarchy map[string]string // The heiarchy of the available contexts
}
This Commit will introduce template support into the command transcripts. This is done via the Golang
text/template
library.For example, in the packaged output of
show_version.txt
the hostname is listed as:Any value in the
fakedevices.FakeDevice
struct can be referenced in this way, today these are:Let me know if you have any questions!
-Brett