Documentation
¶
Overview ¶
Package repl implements the interactive REPL loop for the netconf CLI tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Completer = readline.NewPrefixCompleter( readline.PcItem("connect", readline.PcItem("--host"), readline.PcItem("--port"), readline.PcItem("--user"), readline.PcItem("--password"), readline.PcItem("--key"), readline.PcItem("--known-hosts"), readline.PcItem("--insecure"), ), readline.PcItem("disconnect"), readline.PcItem("get", readline.PcItem("--filter"), readline.PcItem("--subtree"), readline.PcItem("--raw"), ), readline.PcItem("get-config", readline.PcItem("--source", datastoreItems...), readline.PcItem("--filter"), readline.PcItem("--subtree"), readline.PcItem("--raw"), ), readline.PcItem("edit-config", readline.PcItem("--target", datastoreItems...), readline.PcItem("--operation", readline.PcItem("merge"), readline.PcItem("replace"), readline.PcItem("none"), ), readline.PcItem("--config"), ), readline.PcItem("copy-config", readline.PcItem("--source", datastoreItems...), readline.PcItem("--target", datastoreItems...), ), readline.PcItem("delete-config", readline.PcItem("--target", datastoreItems...), ), readline.PcItem("lock", readline.PcItem("--target", datastoreItems...), ), readline.PcItem("unlock", readline.PcItem("--target", datastoreItems...), ), readline.PcItem("commit", readline.PcItem("--confirmed"), readline.PcItem("--timeout"), ), readline.PcItem("discard"), readline.PcItem("validate", readline.PcItem("--source", datastoreItems...), ), readline.PcItem("kill-session", readline.PcItem("--id"), ), readline.PcItem("capabilities"), readline.PcItem("help"), readline.PcItem("version"), readline.PcItem("exit"), readline.PcItem("quit"), )
Completer is the full flag-aware tab-completion tree for the REPL. It is exported so tests can inspect it.
Functions ¶
func PrintXML ¶
PrintXML writes XML body to w, indenting it for readability unless raw is true.
When raw is true, the bytes are written verbatim (useful for piping output to other tools or when the caller needs exact bytes).
When raw is false, prettyXML is called to indent the output. If the input is empty, nothing is written.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds live NETCONF connection state for the REPL. It is safe to call any method on a zero-value Session.
func (*Session) Close ¶
Close sends a NETCONF close-session RPC and releases the transport. Safe to call on an unconnected Session (no-op). Always clears the session state even if the RPC fails.
func (*Session) Host ¶
Host returns the remote host:port string used in the prompt. Returns an empty string when not connected.