Documentation ¶
Index ¶
- Constants
- Variables
- func DBNodeDiff(na, nb *DBNode) string
- func ErrorOnDie(err error)
- func InitAgent(runtimePath, yangPath string) error
- func NewCommand() *cobra.Command
- func ParseXPath(dbm *DatabaseManager, xpath *XPath, s string) error
- type CliMode
- type Command
- type CommandNode
- type CommitHistory
- type CompletionNode
- type CompletionTree
- type Configuration
- type DBNode
- type DBNodeType
- type DBValue
- type DBValueType
- type DatabaseManager
- func (dbm *DatabaseManager) DeleteNode(xpath XPath) error
- func (m *DatabaseManager) Dump()
- func (m *DatabaseManager) DumpEntries() []*yang.Entry
- func (dbm *DatabaseManager) GetNode(xpath XPath) (*DBNode, error)
- func (m *DatabaseManager) LoadDatabaseFromData(n *DBNode) error
- func (m *DatabaseManager) LoadDatabaseFromFile(f string) error
- func (m *DatabaseManager) LoadYangModule(path string) error
- func (m *DatabaseManager) LoadYangModuleOrDie(path string)
- func (dbm *DatabaseManager) SetNode(xpath XPath, val string) (*DBNode, error)
- type XPath
- type XWord
Constants ¶
View Source
const (
QUESTION_MARK rune = 63 // '?'
)
Variables ¶
View Source
var (
GlobalOptRunFilePath string
)
Functions ¶
func DBNodeDiff ¶
func ErrorOnDie ¶
func ErrorOnDie(err error)
func NewCommand ¶
func ParseXPath ¶
func ParseXPath(dbm *DatabaseManager, xpath *XPath, s string) error
Types ¶
type CommandNode ¶
type CommandNode struct {
// contains filtered or unexported fields
}
type CommitHistory ¶
type CommitHistory struct { Timestamp time.Time Before string After string Client string Comment string }
func (CommitHistory) ToDBNode ¶
func (h CommitHistory) ToDBNode() (*DBNode, error)
func (CommitHistory) WriteToFile ¶
func (h CommitHistory) WriteToFile(basepath string) error
type CompletionNode ¶
type CompletionNode struct { Name string Description string Childs []*CompletionNode }
func DigNode ¶
func DigNode(node *CompletionNode, query []string) *CompletionNode
func DigNodeOrDie ¶
func DigNodeOrDie(mode CliMode, query []string) *CompletionNode
func (*CompletionNode) String ¶
func (n *CompletionNode) String() string
type CompletionTree ¶
type CompletionTree struct {
Root *CompletionNode
}
func (*CompletionTree) Completion ¶
func (t *CompletionTree) Completion(line string, pos int) []*CompletionNode
type Configuration ¶
type DBNode ¶
type DBNode struct { Name string Type DBNodeType Childs []DBNode ListChilds [][]DBNode Value DBValue }
func Interface2DBNode ¶
func ReadFromJsonFile ¶
func ReadFromJsonString ¶
func (*DBNode) WriteToJsonFile ¶
type DBNodeType ¶
type DBNodeType string
const ( Container DBNodeType = "container" List DBNodeType = "list" Leaf DBNodeType = "leaf" LeafList DBNodeType = "leaf-list" )
type DBValue ¶
type DBValue struct { Type DBValueType // Union Integer int String string Boolean bool }
func (*DBValue) SetFromString ¶
type DBValueType ¶
type DBValueType string
const ( YString DBValueType = "string" YInteger DBValueType = "integer" YBoolean DBValueType = "boolean" )
func YangTypeKind2YType ¶
func YangTypeKind2YType(t yang.TypeKind) DBValueType
type DatabaseManager ¶
type DatabaseManager struct {
// contains filtered or unexported fields
}
func NewDatabaseManager ¶
func NewDatabaseManager() *DatabaseManager
func (*DatabaseManager) DeleteNode ¶
func (dbm *DatabaseManager) DeleteNode(xpath XPath) error
func (*DatabaseManager) Dump ¶
func (m *DatabaseManager) Dump()
func (*DatabaseManager) DumpEntries ¶
func (m *DatabaseManager) DumpEntries() []*yang.Entry
func (*DatabaseManager) LoadDatabaseFromData ¶
func (m *DatabaseManager) LoadDatabaseFromData(n *DBNode) error
func (*DatabaseManager) LoadDatabaseFromFile ¶
func (m *DatabaseManager) LoadDatabaseFromFile(f string) error
func (*DatabaseManager) LoadYangModule ¶
func (m *DatabaseManager) LoadYangModule(path string) error
func (*DatabaseManager) LoadYangModuleOrDie ¶
func (m *DatabaseManager) LoadYangModuleOrDie(path string)
type XPath ¶
type XPath struct {
// contains filtered or unexported fields
}
func NewXPathOrDie ¶
func NewXPathOrDie(dbm *DatabaseManager, s string) XPath
func ParseXPathArgs ¶
func (XPath) CreateDBNodeTree ¶
Click to show internal directories.
Click to hide internal directories.