Documentation ¶
Index ¶
- Constants
- func AttrsForPath(st Node, path []string) *pathutil.PathAttrs
- func GetHelp(n yang.Node) string
- func NewCompMgr(opsMgr OperationsManager, svcMgr ServiceManager, m yang.ModelSet, ...) *compMgr
- func NormalizePath(st Node, ps []string) ([]string, error)
- func Parse(name, text string) (*parse.Tree, error)
- func ParseModuleDir(dir string) (map[string]*parse.Tree, error)
- func ParseModules(list ...string) (map[string]*parse.Tree, error)
- func ParseYang(locations compile.YangLocator) (map[string]*parse.Tree, error)
- func ValidateSchema(compMgr ComponentManager, sn Node, dn datanode.DataNode, debug bool) ([]*exec.Output, []error, bool)
- func ValidateSchemaWithLog(compMgr ComponentManager, sn Node, dn datanode.DataNode, debug bool, ...) ([]*exec.Output, []error, bool)
- type Binary
- type Bits
- type Boolean
- type Case
- type Choice
- type CompilationExtensions
- func (*CompilationExtensions) ExtendCase(p parse.Node, y yang.Case) (yang.Case, error)
- func (*CompilationExtensions) ExtendChoice(p parse.Node, y yang.Choice) (yang.Choice, error)
- func (*CompilationExtensions) ExtendContainer(p parse.Node, y yang.Container) (yang.Container, error)
- func (*CompilationExtensions) ExtendLeaf(p parse.Node, y yang.Leaf) (yang.Leaf, error)
- func (*CompilationExtensions) ExtendLeafList(p parse.Node, y yang.LeafList) (yang.LeafList, error)
- func (*CompilationExtensions) ExtendList(p parse.Node, y yang.List) (yang.List, error)
- func (*CompilationExtensions) ExtendModel(p parse.Node, m yang.Model, t yang.Tree) (yang.Model, error)
- func (c *CompilationExtensions) ExtendModelSet(m yang.ModelSet) (yang.ModelSet, error)
- func (*CompilationExtensions) ExtendMust(p parse.Node, m parse.Node) (string, error)
- func (*CompilationExtensions) ExtendNotification(p parse.Node, y yang.Notification) (yang.Notification, error)
- func (*CompilationExtensions) ExtendOpdArgument(p parse.Node, y yang.OpdArgument) (yang.OpdArgument, error)
- func (*CompilationExtensions) ExtendOpdCommand(p parse.Node, y yang.OpdCommand) (yang.OpdCommand, error)
- func (*CompilationExtensions) ExtendOpdOption(p parse.Node, y yang.OpdOption) (yang.OpdOption, error)
- func (*CompilationExtensions) ExtendRpc(p parse.Node, y yang.Rpc) (yang.Rpc, error)
- func (*CompilationExtensions) ExtendTree(p parse.Node, y yang.Tree) (yang.Tree, error)
- func (*CompilationExtensions) ExtendType(p parse.Node, base yang.Type, t yang.Type) (yang.Type, error)
- func (e *CompilationExtensions) NodeCardinality(ntype parse.NodeType) map[parse.NodeType]parse.Cardinality
- type ComponentManager
- type ComponentMappings
- func (cm *ComponentMappings) Component(name string) *component
- func (cm *ComponentMappings) Components() map[string]*component
- func (cm *ComponentMappings) DefaultComponent() string
- func (cm *ComponentMappings) GetDefaultServiceModuleMap() map[string]struct{}
- func (cm *ComponentMappings) GetModelNameForNamespace(ns string) (string, bool)
- func (cm *ComponentMappings) OrderedComponents() []string
- type ConfigMultiplexerFn
- type ConfigdExt
- type Container
- type Decimal64
- type Empty
- type Enumeration
- type ExtendedNode
- type Identityref
- type InstanceId
- type Integer
- type Leaf
- type LeafList
- type LeafValue
- type Leafref
- type List
- type ListEntry
- type Model
- type ModelSet
- func CompileDir(cfg *compile.Config, ext *CompilationExtensions) (ModelSet, error)
- func CompileDirKeepMods(cfg *compile.Config, ext *CompilationExtensions) (ModelSet, error, map[string]*parse.Module, map[string]*parse.Module)
- func CompileDirWithWarnings(cfg *compile.Config, ext *CompilationExtensions) (ModelSet, []xutils.Warning, error)
- func CompileModules(mods map[string]*parse.Tree, capabilities string, skipUnknown bool, ...) (ModelSet, error)
- func CompileModulesWithWarnings(mods map[string]*parse.Tree, capabilities string, skipUnknown bool, ...) (ModelSet, []xutils.Warning, error)
- func CompileModulesWithWarningsAndCustomFunctions(mods map[string]*parse.Tree, capabilities string, skipUnknown bool, ...) (ModelSet, []xutils.Warning, error)
- func CompileParseTrees(mods map[string]*parse.Tree, features compile.FeaturesChecker, ...) (ModelSet, error)
- type Node
- type Notification
- type OpdArgument
- type OpdCommand
- type OpdOption
- type OpdOptionValue
- type OperationsManager
- type Rpc
- type ServiceManager
- type StateLogger
- type String
- type TestCompMgr
- func (tcm *TestCompMgr) CheckLogEntries(t *testing.T, name string, entries []TestLogEntry, filter string)
- func (tcm *TestCompMgr) ClearLogEntries()
- func (tcm *TestCompMgr) CommittedConfig(model string) string
- func (cm TestCompMgr) ComponentGetRunning(m ModelSet, cfgMuxFn ConfigMultiplexerFn) (*data.Node, error)
- func (cm TestCompMgr) ComponentGetState(m ModelSet, dn datanode.DataNode, ft *rfc7951data.Tree, logger StateLogger) (*rfc7951data.Tree, error)
- func (cm TestCompMgr) ComponentSetRunning(m ModelSet, dn datanode.DataNode, changedNSMap *map[string]bool) []*exec.Output
- func (cm TestCompMgr) ComponentSetRunningWithLog(m ModelSet, dn datanode.DataNode, changedNSMap *map[string]bool, ...) []*exec.Output
- func (cm TestCompMgr) ComponentValidation(m ModelSet, dn datanode.DataNode, logFn commitTimeLogFn) []error
- func (tcm *TestCompMgr) CurrentState(model string) string
- func (cm TestCompMgr) GetComponentNSMappings() *ComponentMappings
- func (tcm *TestCompMgr) SetCurrentState(model, stateJson string)
- func (tcm *TestCompMgr) ValidatedConfig(model string) string
- type TestLogEntry
- type TmplCompat
- type Tree
- type Type
- type Uinteger
- type Union
- type ValidateCtx
Constants ¶
const ( NoFilter = "" SetRunning = "SetRunning" GetRunning = "GetRunning" GetState = "GetState" Validate = "Validate" )
TestLog provides the ability for tests to verify which components had which operations performed on them (validate, set config, get config, get state), and in which order.
Variables ¶
This section is empty.
Functions ¶
func NewCompMgr ¶
func NewCompMgr( opsMgr OperationsManager, svcMgr ServiceManager, m yang.ModelSet, mappings *ComponentMappings, ) *compMgr
func ValidateSchema ¶
Types ¶
type Case ¶
type Case interface { yang.Case ExtendedNode }
type Choice ¶
type Choice interface { yang.Choice ExtendedNode }
type CompilationExtensions ¶
type CompilationExtensions struct { }
Previously contained information passed through YANG compiler. Left in for now in case of future use given full removal requires changes across 3 repositories.
func (*CompilationExtensions) ExtendCase ¶
func (*CompilationExtensions) ExtendChoice ¶
func (*CompilationExtensions) ExtendContainer ¶
func (*CompilationExtensions) ExtendLeaf ¶
func (*CompilationExtensions) ExtendLeafList ¶
func (*CompilationExtensions) ExtendList ¶
func (*CompilationExtensions) ExtendModel ¶
func (*CompilationExtensions) ExtendModelSet ¶
func (*CompilationExtensions) ExtendMust ¶
func (*CompilationExtensions) ExtendNotification ¶
func (*CompilationExtensions) ExtendNotification( p parse.Node, y yang.Notification, ) (yang.Notification, error)
func (*CompilationExtensions) ExtendOpdArgument ¶
func (*CompilationExtensions) ExtendOpdArgument( p parse.Node, y yang.OpdArgument, ) (yang.OpdArgument, error)
func (*CompilationExtensions) ExtendOpdCommand ¶
func (*CompilationExtensions) ExtendOpdCommand( p parse.Node, y yang.OpdCommand, ) (yang.OpdCommand, error)
func (*CompilationExtensions) ExtendOpdOption ¶
func (*CompilationExtensions) ExtendTree ¶
func (*CompilationExtensions) ExtendType ¶
func (*CompilationExtensions) NodeCardinality ¶
func (e *CompilationExtensions) NodeCardinality( ntype parse.NodeType, ) map[parse.NodeType]parse.Cardinality
type ComponentManager ¶
type ComponentManager interface { OperationsManager ServiceManager GetComponentNSMappings() *ComponentMappings ComponentValidation( ModelSet, datanode.DataNode, commitTimeLogFn, ) []error ComponentSetRunning( ModelSet, datanode.DataNode, *map[string]bool, ) []*exec.Output ComponentSetRunningWithLog( ModelSet, datanode.DataNode, *map[string]bool, commitTimeLogFn, ) []*exec.Output ComponentGetRunning( ModelSet, ConfigMultiplexerFn, ) (*data.Node, error) ComponentGetState( ModelSet, datanode.DataNode, *rfc7951data.Tree, StateLogger, ) (*rfc7951data.Tree, error) }
ComponentManager encapsulates bus operations to/from components, and service queries against the components' service status.
type ComponentMappings ¶
type ComponentMappings struct {
// contains filtered or unexported fields
}
func CreateComponentNSMappings ¶
func CreateComponentNSMappings( m yang.ModelSet, modelSetName string, compConfig []*conf.ServiceConfig, ) (*ComponentMappings, error)
func (*ComponentMappings) Component ¶
func (cm *ComponentMappings) Component(name string) *component
func (*ComponentMappings) Components ¶
func (cm *ComponentMappings) Components() map[string]*component
func (*ComponentMappings) DefaultComponent ¶
func (cm *ComponentMappings) DefaultComponent() string
func (*ComponentMappings) GetDefaultServiceModuleMap ¶
func (cm *ComponentMappings) GetDefaultServiceModuleMap() map[string]struct{}
func (*ComponentMappings) GetModelNameForNamespace ¶
func (cm *ComponentMappings) GetModelNameForNamespace(ns string) (string, bool)
func (*ComponentMappings) OrderedComponents ¶
func (cm *ComponentMappings) OrderedComponents() []string
type ConfigdExt ¶
type ConfigdExt struct { Help string Validate []string Syntax []string Priority uint Normalize string Allowed string Begin []string End []string Create []string Update []string Delete []string Subst []string Secret bool DeferActions string Must string PatternHelp []string CallRpc string GetState []string OpdHelp string OpdAllowed string OpdPatternHelp []string }
func (*ConfigdExt) Copy ¶
func (ext *ConfigdExt) Copy() *ConfigdExt
func (*ConfigdExt) GetHelp ¶
func (ext *ConfigdExt) GetHelp() string
Get the help text for a node, if absent, return <No help text available>
func (*ConfigdExt) GetTypeHelp ¶
func (ext *ConfigdExt) GetTypeHelp() string
Get the help text as is, suitable for a type node
func (*ConfigdExt) Merge ¶
func (ext *ConfigdExt) Merge(in *ConfigdExt) *ConfigdExt
Types require merging of base data into new type
func (*ConfigdExt) Override ¶
func (ext *ConfigdExt) Override(in *ConfigdExt) *ConfigdExt
type Container ¶
type Container interface { yang.Container ExtendedNode }
type Enumeration ¶
type Enumeration interface { yang.Enumeration // contains filtered or unexported methods }
type ExtendedNode ¶
type Identityref ¶
type Identityref interface { yang.Identityref // contains filtered or unexported methods }
type InstanceId ¶
type InstanceId interface { yang.InstanceId // contains filtered or unexported methods }
type Leaf ¶
type Leaf interface { yang.Leaf ExtendedNode }
type LeafList ¶
type LeafList interface { yang.LeafList ExtendedNode }
type LeafValue ¶
type LeafValue interface { yang.LeafValue ExtendedNode }
type List ¶
type List interface { yang.List ExtendedNode }
type ListEntry ¶
type ListEntry interface { yang.ListEntry ExtendedNode }
type ModelSet ¶
type ModelSet interface { yang.ModelSet ExtendedNode PathDescendant([]string) *TmplCompat OpdPathDescendant([]string) *TmplCompat }
func CompileDir ¶
func CompileDir(cfg *compile.Config, ext *CompilationExtensions) (ModelSet, error)
func CompileDirKeepMods ¶
func CompileDirKeepMods( cfg *compile.Config, ext *CompilationExtensions, ) (ModelSet, error, map[string]*parse.Module, map[string]*parse.Module)
If you need to be able to look up prefix / module mappings after the schema has been compiled, then this function provides the module and submodule data to do this.
func CompileDirWithWarnings ¶
func CompileModules ¶
func CompileModules( mods map[string]*parse.Tree, capabilities string, skipUnknown bool, filter compile.SchemaFilter, ext *CompilationExtensions, ) (ModelSet, error)
func CompileModulesWithWarningsAndCustomFunctions ¶
func CompileModulesWithWarningsAndCustomFunctions( mods map[string]*parse.Tree, capabilities string, skipUnknown bool, filter compile.SchemaFilter, ext *CompilationExtensions, userFnChecker xpath.UserCustomFunctionCheckerFn, ) (ModelSet, []xutils.Warning, error)
func CompileParseTrees ¶
func CompileParseTrees( mods map[string]*parse.Tree, features compile.FeaturesChecker, skipUnknown bool, filter compile.SchemaFilter, ext *CompilationExtensions, ) (ModelSet, error)
type Notification ¶
type Notification interface { yang.Notification }
type OpdArgument ¶
type OpdArgument interface { yang.OpdArgument ExtendedNode }
type OpdCommand ¶
type OpdCommand interface { yang.OpdCommand ExtendedNode }
type OpdOption ¶
type OpdOption interface { yang.OpdOption ExtendedNode }
type OpdOptionValue ¶
type OpdOptionValue interface { yang.OpdOptionValue ExtendedNode }
type OperationsManager ¶
type ServiceManager ¶
type StateLogger ¶
type StateLogger interface { Printf(format string, a ...interface{}) Println(a ...interface{}) }
type TestCompMgr ¶
type TestCompMgr struct {
// contains filtered or unexported fields
}
func NewTestCompMgr ¶
func NewTestCompMgr( t *testing.T, ms yang.ModelSet, mappings *ComponentMappings, ) *TestCompMgr
func (*TestCompMgr) CheckLogEntries ¶
func (tcm *TestCompMgr) CheckLogEntries( t *testing.T, name string, entries []TestLogEntry, filter string, )
func (*TestCompMgr) ClearLogEntries ¶
func (tcm *TestCompMgr) ClearLogEntries()
func (*TestCompMgr) CommittedConfig ¶
func (tcm *TestCompMgr) CommittedConfig(model string) string
func (TestCompMgr) ComponentGetRunning ¶
func (cm TestCompMgr) ComponentGetRunning( m ModelSet, cfgMuxFn ConfigMultiplexerFn, ) (*data.Node, error)
func (TestCompMgr) ComponentGetState ¶
func (cm TestCompMgr) ComponentGetState( m ModelSet, dn datanode.DataNode, ft *rfc7951data.Tree, logger StateLogger, ) (*rfc7951data.Tree, error)
func (TestCompMgr) ComponentSetRunning ¶
func (TestCompMgr) ComponentSetRunningWithLog ¶
func (TestCompMgr) ComponentValidation ¶
func (*TestCompMgr) CurrentState ¶
func (tcm *TestCompMgr) CurrentState(model string) string
func (TestCompMgr) GetComponentNSMappings ¶
func (cm TestCompMgr) GetComponentNSMappings() *ComponentMappings
func (*TestCompMgr) SetCurrentState ¶
func (tcm *TestCompMgr) SetCurrentState(model, stateJson string)
func (*TestCompMgr) ValidatedConfig ¶
func (tcm *TestCompMgr) ValidatedConfig(model string) string
type TestLogEntry ¶
type TestLogEntry struct {
// contains filtered or unexported fields
}
func NewTestLogEntry ¶
func NewTestLogEntry(fn string, params ...string) TestLogEntry
type TmplCompat ¶
type Tree ¶
type Tree interface { yang.Tree ExtendedNode }
type ValidateCtx ¶
type ValidateCtx struct { Noexec bool CurPath []string Path string Sid string St ModelSet IncompletePathIsValid bool }
func (ValidateCtx) AllowIncompletePaths ¶
func (v ValidateCtx) AllowIncompletePaths() bool
func (ValidateCtx) ErrorHelpText ¶
func (v ValidateCtx) ErrorHelpText() []string