meta

package
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 13

Documentation

Overview

Package meta is the AST(Abstract Syntax Tree) of parsed YANG. Data structures here closely follows the YANG RFC specification at the IETF. To build an AST from a YANG file, use the parser package.

Index

Constants

View Source
const (
	OrderedBySystem = iota
	OrderedByUser
)

Variables

This section is empty.

Functions

func Compile

func Compile(root *Module) error

func IsAction

func IsAction(m Meta) bool

IsAction returns true is meta is *Rpc (YANG rpm or action)

func IsChoice

func IsChoice(m Meta) bool

func IsChoiceCase

func IsChoiceCase(m Meta) bool

func IsContainer

func IsContainer(m Meta) bool

IsContainer return true if meta is *Module or *Container

func IsDataDef

func IsDataDef(m Meta) bool

IsDataDef is *Container, *List or Leaf

func IsLeaf

func IsLeaf(m Meta) bool

IsList returns true if meta is *Leaf or *LeafList

func IsList

func IsList(m Meta) bool

IsList returns true if meta is *List

func IsNotification

func IsNotification(m Meta) bool

IsNotification returns true if meta is *Notification

func SchemaPath

func SchemaPath(m Meta) string

SchemaPath as determined in the information model (e.g. YANG), not data model (e.g. RESTCONF).

Example:

    module x  {
	  list foo {
		  leaf bar {
			  ...

	Path on Meta structure for leaf would be 'x/foo/bar'

Types

type AddDeviate

type AddDeviate struct {
	// contains filtered or unexported fields
}

func (*AddDeviate) Config

func (m *AddDeviate) Config() bool

func (*AddDeviate) Default

func (m *AddDeviate) Default() []string

func (*AddDeviate) DefaultValue

func (m *AddDeviate) DefaultValue() interface{}

func (*AddDeviate) Extensions

func (m *AddDeviate) Extensions() []*Extension

func (*AddDeviate) HasDefault

func (m *AddDeviate) HasDefault() bool

func (*AddDeviate) IsConfigSet

func (m *AddDeviate) IsConfigSet() bool

func (*AddDeviate) IsMandatorySet

func (m *AddDeviate) IsMandatorySet() bool

func (*AddDeviate) IsMaxElementsSet

func (m *AddDeviate) IsMaxElementsSet() bool

func (*AddDeviate) IsMinElementsSet

func (m *AddDeviate) IsMinElementsSet() bool

func (*AddDeviate) Mandatory

func (m *AddDeviate) Mandatory() bool

func (*AddDeviate) MaxElements

func (m *AddDeviate) MaxElements() int

MaxElements return 0 when unbounded

func (*AddDeviate) MinElements

func (m *AddDeviate) MinElements() int

func (*AddDeviate) Musts

func (m *AddDeviate) Musts() []*Must

func (*AddDeviate) Parent

func (m *AddDeviate) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*AddDeviate) Unique

func (m *AddDeviate) Unique() [][]string

Unique is list of fields (or compound fields) that must be unque in the list of items. If there is a key listed, that is implicitly unique and would not be listed here.

func (*AddDeviate) Units

func (m *AddDeviate) Units() string

type Any

type Any struct {
	// contains filtered or unexported fields
}

func (*Any) Config

func (m *Any) Config() bool

func (*Any) DefaultValue

func (y *Any) DefaultValue() interface{}

func (*Any) Description

func (m *Any) Description() string

Description of Any

func (*Any) Extensions

func (m *Any) Extensions() []*Extension

func (*Any) HasDefault

func (y *Any) HasDefault() bool

func (*Any) Ident

func (m *Any) Ident() string

Ident is identity of Any

func (*Any) IfFeatures

func (m *Any) IfFeatures() []*IfFeature

func (*Any) IsConfigSet

func (m *Any) IsConfigSet() bool

func (*Any) IsMandatorySet

func (m *Any) IsMandatorySet() bool

func (*Any) Mandatory

func (m *Any) Mandatory() bool

func (*Any) Musts

func (m *Any) Musts() []*Must

func (*Any) Parent

func (m *Any) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Any) Reference

func (m *Any) Reference() string

func (*Any) Type

func (y *Any) Type() *Type

func (*Any) Units

func (y *Any) Units() string

func (*Any) When

func (m *Any) When() *When

type Augment

type Augment struct {
	// contains filtered or unexported fields
}

func (*Augment) Actions

func (m *Augment) Actions() map[string]*Rpc

func (*Augment) DataDefinition

func (m *Augment) DataDefinition(ident string) Definition

func (*Augment) DataDefinitions

func (m *Augment) DataDefinitions() []Definition

func (*Augment) Definition

func (m *Augment) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*Augment) Description

func (m *Augment) Description() string

Description of Augment

func (*Augment) Extensions

func (m *Augment) Extensions() []*Extension

func (*Augment) Ident

func (m *Augment) Ident() string

Ident is identity of Augment

func (*Augment) IfFeatures

func (m *Augment) IfFeatures() []*IfFeature

func (*Augment) IsRecursive

func (m *Augment) IsRecursive() bool

func (*Augment) Notifications

func (m *Augment) Notifications() map[string]*Notification

func (*Augment) Parent

func (m *Augment) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Augment) Reference

func (m *Augment) Reference() string

func (*Augment) When

func (m *Augment) When() *When

type BelongsTo

type BelongsTo struct {
	Module *Module
	// contains filtered or unexported fields
}

func (*BelongsTo) Prefix

func (b *BelongsTo) Prefix() string

type Bit

type Bit struct {
	Position int
	// contains filtered or unexported fields
}

func (*Bit) Description

func (m *Bit) Description() string

Description of Bit

func (*Bit) Extensions

func (m *Bit) Extensions() []*Extension

func (*Bit) Ident

func (m *Bit) Ident() string

Ident is identity of Bit

func (*Bit) Reference

func (m *Bit) Reference() string

type Builder

type Builder struct {
	LastErr error
}

func (*Builder) Action

func (b *Builder) Action(o interface{}, ident string) *Rpc

func (*Builder) ActionInput

func (b *Builder) ActionInput(o interface{}) *RpcInput

func (*Builder) ActionOutput

func (b *Builder) ActionOutput(o interface{}) *RpcOutput

func (*Builder) AddDeviate

func (b *Builder) AddDeviate(o interface{}) *AddDeviate

func (*Builder) AddExtension

func (b *Builder) AddExtension(o interface{}, keyword string, ext *Extension)

func (*Builder) Any

func (b *Builder) Any(o interface{}, ident string) *Any

func (*Builder) Augment

func (b *Builder) Augment(o interface{}, path string) *Augment

func (*Builder) Base

func (b *Builder) Base(o interface{}, base string)

Base to set for identity or type objects

func (*Builder) BelongsTo

func (b *Builder) BelongsTo(o interface{}, moduleName string) *BelongsTo

func (*Builder) Bit

func (b *Builder) Bit(o interface{}, ident string) *Bit

func (*Builder) Case

func (b *Builder) Case(o interface{}, ident string) *ChoiceCase

func (*Builder) Choice

func (b *Builder) Choice(o interface{}, ident string) *Choice

func (*Builder) Config

func (b *Builder) Config(o interface{}, config bool)

func (*Builder) Contact

func (b *Builder) Contact(o interface{}, c string)

func (*Builder) Container

func (b *Builder) Container(o interface{}, ident string) *Container

func (*Builder) Default

func (b *Builder) Default(o interface{}, defaultVal string)

func (*Builder) Defaults

func (b *Builder) Defaults(o interface{}, defaultVal []string)

func (*Builder) DeleteDeviate

func (b *Builder) DeleteDeviate(o interface{}) *DeleteDeviate

func (*Builder) Description

func (b *Builder) Description(o interface{}, desc string)

func (*Builder) Deviation

func (b *Builder) Deviation(o interface{}, ident string) *Deviation

func (*Builder) Enum

func (b *Builder) Enum(o interface{}, label string) *Enum

func (*Builder) EnumValue

func (b *Builder) EnumValue(o interface{}, x int)

func (*Builder) ErrorAppTag

func (b *Builder) ErrorAppTag(o interface{}, tag string)

func (*Builder) ErrorMessage

func (b *Builder) ErrorMessage(o interface{}, msg string)

func (*Builder) Extension

func (b *Builder) Extension(prefixAndIdent string, args []string) *Extension

func (*Builder) ExtensionDef

func (b *Builder) ExtensionDef(o interface{}, ident string) *ExtensionDef

func (*Builder) ExtensionDefArg

func (b *Builder) ExtensionDefArg(o interface{}, ident string) *ExtensionDefArg

func (*Builder) Feature

func (b *Builder) Feature(o interface{}, ident string) *Feature

func (*Builder) FractionDigits

func (b *Builder) FractionDigits(o interface{}, x int)

func (*Builder) Grouping

func (b *Builder) Grouping(o interface{}, ident string) *Grouping

func (*Builder) Identity

func (b *Builder) Identity(o interface{}, ident string) *Identity

func (*Builder) IfFeature

func (b *Builder) IfFeature(o interface{}, expression string) *IfFeature

func (*Builder) Import

func (b *Builder) Import(o interface{}, moduleName string, loader Loader) *Import

func (*Builder) Include

func (b *Builder) Include(o interface{}, subName string, loader Loader) *Include

func (*Builder) Key

func (b *Builder) Key(o interface{}, keys string)

func (*Builder) Leaf

func (b *Builder) Leaf(o interface{}, ident string) *Leaf

func (*Builder) LeafList

func (b *Builder) LeafList(o interface{}, ident string) *LeafList

func (*Builder) LengthRange

func (b *Builder) LengthRange(o interface{}, arg string) *Range

func (*Builder) List

func (b *Builder) List(o interface{}, ident string) *List

func (*Builder) Mandatory

func (b *Builder) Mandatory(o interface{}, m bool)

func (*Builder) MaxElements

func (b *Builder) MaxElements(o interface{}, i int)

func (*Builder) MinElements

func (b *Builder) MinElements(o interface{}, i int)

func (*Builder) Module

func (b *Builder) Module(ident string, fs FeatureSet) *Module

func (*Builder) Must

func (b *Builder) Must(o interface{}, expression string) *Must

func (*Builder) Namespace

func (b *Builder) Namespace(o interface{}, ns string)

func (*Builder) NotSupported

func (b *Builder) NotSupported(o interface{})

func (*Builder) Notification

func (b *Builder) Notification(o interface{}, ident string) *Notification

func (*Builder) OrderedBy

func (b *Builder) OrderedBy(o interface{}, order OrderedBy)

func (*Builder) Organization

func (b *Builder) Organization(o interface{}, org string)

func (*Builder) Path

func (b *Builder) Path(o interface{}, p string)

func (*Builder) Pattern

func (b *Builder) Pattern(o interface{}, pattern string) *Pattern

func (*Builder) Position

func (b *Builder) Position(o interface{}, x int)

func (*Builder) Prefix

func (b *Builder) Prefix(o interface{}, prefix string)

func (*Builder) Presence

func (b *Builder) Presence(o interface{}, desc string)

func (*Builder) Reference

func (b *Builder) Reference(o interface{}, r string)

func (*Builder) Refine

func (b *Builder) Refine(o interface{}, path string) *Refine

func (*Builder) ReplaceDeviate

func (b *Builder) ReplaceDeviate(o interface{}) *ReplaceDeviate

func (*Builder) RequireInstance

func (b *Builder) RequireInstance(o interface{}, require bool)

func (*Builder) Revision

func (b *Builder) Revision(o interface{}, rev string) *Revision

func (*Builder) SetInverted

func (b *Builder) SetInverted(o interface{})

func (*Builder) SetRevisionDate

func (b *Builder) SetRevisionDate(o interface{}, revisionDate string)

func (*Builder) Submodule

func (b *Builder) Submodule(parent *Module, ident string, fs FeatureSet) *Module

func (*Builder) Type

func (b *Builder) Type(o interface{}, ident string) *Type

func (*Builder) Typedef

func (b *Builder) Typedef(o interface{}, ident string) *Typedef

func (*Builder) UnBounded

func (b *Builder) UnBounded(o interface{}, x bool)

func (*Builder) Unique

func (b *Builder) Unique(o interface{}, unique string)

func (*Builder) Units

func (b *Builder) Units(o interface{}, units string)

func (*Builder) Uses

func (b *Builder) Uses(o interface{}, ident string) *Uses

func (*Builder) ValueRange

func (b *Builder) ValueRange(o interface{}, arg string) *Range

func (*Builder) When

func (b *Builder) When(o interface{}, expression string) *When

func (*Builder) YangVersion

func (b *Builder) YangVersion(o interface{}, ver string)

func (*Builder) YinElement

func (b *Builder) YinElement(o interface{}, prop bool)

type Choice

type Choice struct {
	// contains filtered or unexported fields
}

func (*Choice) CaseIdents

func (y *Choice) CaseIdents() []string

func (*Choice) Cases

func (y *Choice) Cases() map[string]*ChoiceCase

func (*Choice) Config

func (m *Choice) Config() bool

func (*Choice) Default

func (m *Choice) Default() string

func (*Choice) DefaultValue

func (m *Choice) DefaultValue() interface{}

func (*Choice) Description

func (m *Choice) Description() string

Description of Choice

func (*Choice) Extensions

func (m *Choice) Extensions() []*Extension

func (*Choice) HasDefault

func (m *Choice) HasDefault() bool

func (*Choice) Ident

func (m *Choice) Ident() string

Ident is identity of Choice

func (*Choice) IfFeatures

func (m *Choice) IfFeatures() []*IfFeature

func (*Choice) IsConfigSet

func (m *Choice) IsConfigSet() bool

func (*Choice) IsMandatorySet

func (m *Choice) IsMandatorySet() bool

func (*Choice) Mandatory

func (m *Choice) Mandatory() bool

func (*Choice) Parent

func (m *Choice) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Choice) Reference

func (m *Choice) Reference() string

func (*Choice) Status

func (m *Choice) Status() Status

func (*Choice) When

func (m *Choice) When() *When

type ChoiceCase

type ChoiceCase struct {
	// contains filtered or unexported fields
}

func (*ChoiceCase) DataDefinition

func (m *ChoiceCase) DataDefinition(ident string) Definition

func (*ChoiceCase) DataDefinitions

func (m *ChoiceCase) DataDefinitions() []Definition

func (*ChoiceCase) Definition

func (m *ChoiceCase) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*ChoiceCase) Description

func (m *ChoiceCase) Description() string

Description of ChoiceCase

func (*ChoiceCase) Extensions

func (m *ChoiceCase) Extensions() []*Extension

func (*ChoiceCase) Ident

func (m *ChoiceCase) Ident() string

Ident is identity of ChoiceCase

func (*ChoiceCase) IfFeatures

func (m *ChoiceCase) IfFeatures() []*IfFeature

func (*ChoiceCase) IsRecursive

func (m *ChoiceCase) IsRecursive() bool

func (*ChoiceCase) Parent

func (m *ChoiceCase) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*ChoiceCase) Reference

func (m *ChoiceCase) Reference() string

func (*ChoiceCase) When

func (m *ChoiceCase) When() *When

type Container

type Container struct {
	// contains filtered or unexported fields
}

func (*Container) Actions

func (m *Container) Actions() map[string]*Rpc

func (*Container) Config

func (m *Container) Config() bool

func (*Container) DataDefinition

func (m *Container) DataDefinition(ident string) Definition

func (*Container) DataDefinitions

func (m *Container) DataDefinitions() []Definition

func (*Container) Definition

func (m *Container) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*Container) Description

func (m *Container) Description() string

Description of Container

func (*Container) Extensions

func (m *Container) Extensions() []*Extension

func (*Container) Groupings

func (m *Container) Groupings() map[string]*Grouping

func (*Container) Ident

func (m *Container) Ident() string

Ident is identity of Container

func (*Container) IfFeatures

func (m *Container) IfFeatures() []*IfFeature

func (*Container) IsConfigSet

func (m *Container) IsConfigSet() bool

func (*Container) IsMandatorySet

func (m *Container) IsMandatorySet() bool

func (*Container) IsRecursive

func (m *Container) IsRecursive() bool

func (*Container) Mandatory

func (m *Container) Mandatory() bool

func (*Container) Musts

func (m *Container) Musts() []*Must

func (*Container) Notifications

func (m *Container) Notifications() map[string]*Notification

func (*Container) Parent

func (m *Container) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Container) Presence

func (m *Container) Presence() string

Presence describes what the existance of this container in the data model means. https://tools.ietf.org/html/rfc7950#section-7.5.1

func (*Container) Reference

func (m *Container) Reference() string

func (*Container) Status

func (m *Container) Status() Status

func (*Container) Typedefs

func (m *Container) Typedefs() map[string]*Typedef

func (*Container) When

func (m *Container) When() *When

type Definition

type Definition interface {
	Meta
	Identifiable
	// contains filtered or unexported methods
}

Definition data structure defining details. This includes data definitions like container and leaf, but also notifications and actions

func Find

func Find(p Meta, path string) Definition

type DeleteDeviate

type DeleteDeviate struct {
	// contains filtered or unexported fields
}

func (*DeleteDeviate) Default

func (m *DeleteDeviate) Default() []string

func (*DeleteDeviate) DefaultValue

func (m *DeleteDeviate) DefaultValue() interface{}

func (*DeleteDeviate) Extensions

func (m *DeleteDeviate) Extensions() []*Extension

func (*DeleteDeviate) HasDefault

func (m *DeleteDeviate) HasDefault() bool

func (*DeleteDeviate) Musts

func (m *DeleteDeviate) Musts() []*Must

func (*DeleteDeviate) Parent

func (m *DeleteDeviate) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*DeleteDeviate) Unique

func (m *DeleteDeviate) Unique() [][]string

Unique is list of fields (or compound fields) that must be unque in the list of items. If there is a key listed, that is implicitly unique and would not be listed here.

func (*DeleteDeviate) Units

func (m *DeleteDeviate) Units() string

type Describable

type Describable interface {

	// Description of meta item
	Description() string

	// Reference is a human-readable, cross-reference to some external source.  Example: Item #89 of foo catalog"
	Reference() string
	// contains filtered or unexported methods
}

Describable is anything that can have a description, oddly, most data definitions except 'case', 'input' or 'output'

type Deviation

type Deviation struct {

	// NotSupported is true, then target node can be removed
	NotSupported bool

	// Add properties to target
	Add *AddDeviate

	// Replace properties from target
	Replace *ReplaceDeviate

	// Delete properties from target
	Delete *DeleteDeviate
	// contains filtered or unexported fields
}

Deviation is a lot like refine but can be used without the "uses" statement and instead right on node tree. This is typically used for vendors attempting to implement a industry standard YANG model but have some changes

func (*Deviation) Description

func (m *Deviation) Description() string

Description of Deviation

func (*Deviation) Extensions

func (m *Deviation) Extensions() []*Extension

func (*Deviation) Ident

func (m *Deviation) Ident() string

Ident is identity of Deviation

func (*Deviation) Parent

func (m *Deviation) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Deviation) Reference

func (m *Deviation) Reference() string

type Enum

type Enum struct {
	// contains filtered or unexported fields
}

func (*Enum) Description

func (m *Enum) Description() string

Description of Enum

func (*Enum) Extensions

func (m *Enum) Extensions() []*Extension

func (*Enum) Ident

func (m *Enum) Ident() string

Ident is identity of Enum

func (*Enum) Reference

func (m *Enum) Reference() string

func (*Enum) Value

func (y *Enum) Value() int

type Extension

type Extension struct {
	// contains filtered or unexported fields
}

Extension is a very powerful concept in YANG. It let's you extend YANG language to have defintions for whatever you wish it had. It's like a meta language inside the YANG (which is already a meta language). Can extensions have extensions? you bet. See YANG RFC on extensions for more information.

https://tools.ietf.org/html/rfc7950#section-6.3.1

YANG lets you extend everything, including simple statements like description. e.g.

    container x {
	       description "X" {
           my-ext:this-is-secondary-on-container-keyword-description;
        }
    }

This extension would be listed in the extensions for the *Container object but would have OnKeyword of "description" to distinguish it from extensions extension of container itself.

func FindExtension

func FindExtension(name string, candidates []*Extension) *Extension

FindExtension simply finds an extension by name in a list of extensions

func (*Extension) Arguments

func (y *Extension) Arguments() []string

Arguments are optional argumes to extension. The extension definition will define what arguments are allowed if any.

func (*Extension) Definition

func (y *Extension) Definition() *ExtensionDef

Definition is define the schema for this extension instance

func (*Extension) Extensions

func (m *Extension) Extensions() []*Extension

func (*Extension) Ident

func (m *Extension) Ident() string

Ident is identity of Extension

func (*Extension) Keyword

func (y *Extension) Keyword() string

Keyword is set when there are extensions of things that do not have a data structure to store them and a likely just Go scalar values. Examples: description, reference, units, max-length etc.

func (*Extension) Parent

func (m *Extension) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Extension) Prefix

func (y *Extension) Prefix() string

Prefix name of extention which according to YANG spec is ALWAYS required even when the extension definition is local. In this example it is "foo"

container x {
    foo:bar;
}

type ExtensionDef

type ExtensionDef struct {
	// contains filtered or unexported fields
}

func (*ExtensionDef) Arguments

func (y *ExtensionDef) Arguments() []*ExtensionDefArg

func (*ExtensionDef) Description

func (m *ExtensionDef) Description() string

Description of ExtensionDef

func (*ExtensionDef) Extensions

func (m *ExtensionDef) Extensions() []*Extension

func (*ExtensionDef) Ident

func (m *ExtensionDef) Ident() string

Ident is identity of ExtensionDef

func (*ExtensionDef) Parent

func (m *ExtensionDef) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*ExtensionDef) Reference

func (m *ExtensionDef) Reference() string

func (*ExtensionDef) Status

func (m *ExtensionDef) Status() Status

type ExtensionDefArg

type ExtensionDefArg struct {
	// contains filtered or unexported fields
}

func (*ExtensionDefArg) Description

func (m *ExtensionDefArg) Description() string

Description of ExtensionDefArg

func (*ExtensionDefArg) Extensions

func (m *ExtensionDefArg) Extensions() []*Extension

func (*ExtensionDefArg) Ident

func (m *ExtensionDefArg) Ident() string

Ident is identity of ExtensionDefArg

func (*ExtensionDefArg) Parent

func (m *ExtensionDefArg) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*ExtensionDefArg) Reference

func (m *ExtensionDefArg) Reference() string

func (*ExtensionDefArg) YinElement

func (y *ExtensionDefArg) YinElement() bool

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

func (*Feature) Description

func (m *Feature) Description() string

Description of Feature

func (*Feature) Extensions

func (m *Feature) Extensions() []*Extension

func (*Feature) Ident

func (m *Feature) Ident() string

Ident is identity of Feature

func (*Feature) IfFeatures

func (m *Feature) IfFeatures() []*IfFeature

func (*Feature) Parent

func (m *Feature) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Feature) Reference

func (m *Feature) Reference() string

type FeatureSet

type FeatureSet interface {
	Initialize(m *Module) error
	Resolve(*IfFeature) (bool, error)
}

func AllFeaturesOn

func AllFeaturesOn() FeatureSet

func FeaturesOff

func FeaturesOff(features []string) FeatureSet

All other features will be on. Effectively a whitelist.

func FeaturesOn

func FeaturesOn(features []string) FeatureSet

All other features will be off. Effectively a blacklist.

type Grouping

type Grouping struct {
	// contains filtered or unexported fields
}

*

RFC7950 Sec 7.12 The "grouping" Statement

Identifiers appearing inside
the grouping are resolved relative to the scope in which the grouping
is defined, not where it is used.  Prefix mappings, type names,
grouping names, and extension usage are evaluated in the hierarchy
where the "grouping" statement appears.  For extensions, this means
that extensions defined as direct children to a "grouping" statement
are applied to the grouping itself.

func (*Grouping) Actions

func (m *Grouping) Actions() map[string]*Rpc

func (*Grouping) DataDefinition

func (m *Grouping) DataDefinition(ident string) Definition

func (*Grouping) DataDefinitions

func (m *Grouping) DataDefinitions() []Definition

func (*Grouping) Definition

func (m *Grouping) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*Grouping) Description

func (m *Grouping) Description() string

Description of Grouping

func (*Grouping) Extensions

func (m *Grouping) Extensions() []*Extension

func (*Grouping) Groupings

func (m *Grouping) Groupings() map[string]*Grouping

func (*Grouping) Ident

func (m *Grouping) Ident() string

Ident is identity of Grouping

func (*Grouping) IsRecursive

func (m *Grouping) IsRecursive() bool

func (*Grouping) Notifications

func (m *Grouping) Notifications() map[string]*Notification

func (*Grouping) Parent

func (m *Grouping) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Grouping) Reference

func (m *Grouping) Reference() string

func (*Grouping) Typedefs

func (m *Grouping) Typedefs() map[string]*Typedef

type HasActions

type HasActions interface {
	HasDataDefinitions
	Actions() map[string]*Rpc
	// contains filtered or unexported methods
}

type HasAugments

type HasAugments interface {
	Augments() []*Augment
	// contains filtered or unexported methods
}

type HasCases

type HasCases interface {
	Definition
	// contains filtered or unexported methods
}

type HasConfig

type HasConfig interface {
	Config() bool
	IsConfigSet() bool
	// contains filtered or unexported methods
}

type HasDataDefinitions

type HasDataDefinitions interface {
	HasDefinitions

	DataDefinitions() []Definition
	// contains filtered or unexported methods
}

HasDefinitions holds container, leaf, list, etc definitions which often (but not always) also hold notifications and actions

type HasDefault

type HasDefault interface {
	HasDefault() bool

	DefaultValue() interface{}
	// contains filtered or unexported methods
}

type HasDefaultValue

type HasDefaultValue interface {
	HasDefault
	Default() string
	// contains filtered or unexported methods
}

type HasDefaultValues

type HasDefaultValues interface {
	HasDefault
	Default() []string
	// contains filtered or unexported methods
}

type HasDefinitions

type HasDefinitions interface {
	Definition

	// Definition returns DataDefinition, Action or Notification by name
	Definition(ident string) Definition

	// rare chance this is part of a recursive schema.  If so, care should
	// be taken navigating the schema tree (information model).  Navigating
	// the actual config/metrics (data model) should not be a problem
	IsRecursive() bool
	// contains filtered or unexported methods
}

type HasDetails

type HasDetails interface {
	Definition
	HasMandatory
	HasConfig
}

type HasErrorMessage

type HasErrorMessage interface {
	ErrorMessage() string

	ErrorAppTag() string
	// contains filtered or unexported methods
}

type HasExtensions

type HasExtensions interface {
	// User customized YANG found in the body
	Extensions() []*Extension
	// contains filtered or unexported methods
}

HasExtensions is support by almost every structure. See YANG language extensions for more information

type HasGroupings

type HasGroupings interface {
	HasDataDefinitions
	Groupings() map[string]*Grouping
	// contains filtered or unexported methods
}

type HasIfFeatures

type HasIfFeatures interface {
	IfFeatures() []*IfFeature
	// contains filtered or unexported methods
}

type HasListDetails

type HasListDetails interface {
	Definition
	HasMinMax
	HasUnbounded
	HasOrderedBy
}

type HasMandatory

type HasMandatory interface {
	Mandatory() bool
	IsMandatorySet() bool
	// contains filtered or unexported methods
}

type HasMinMax

type HasMinMax interface {
	MaxElements() int
	IsMaxElementsSet() bool

	MinElements() int
	IsMinElementsSet() bool
	// contains filtered or unexported methods
}

type HasMusts

type HasMusts interface {
	Musts() []*Must
	// contains filtered or unexported methods
}

type HasNotifications

type HasNotifications interface {
	HasDataDefinitions
	Notifications() map[string]*Notification
	// contains filtered or unexported methods
}

type HasOrderedBy

type HasOrderedBy interface {
	OrderedBy() OrderedBy
	// contains filtered or unexported methods
}

type HasPresence

type HasPresence interface {
	Meta
	Presence() string
	// contains filtered or unexported methods
}

type HasStatus

type HasStatus interface {
	Meta

	// Status is useful to mark things deprecated
	Status() Status
	// contains filtered or unexported methods
}

type HasType

type HasType interface {
	Type() *Type
	// contains filtered or unexported methods
}

type HasTypedefs

type HasTypedefs interface {
	Typedefs() map[string]*Typedef
	// contains filtered or unexported methods
}

type HasUnbounded

type HasUnbounded interface {
	Unbounded() bool
	IsUnboundedSet() bool
	// contains filtered or unexported methods
}

type HasUnique

type HasUnique interface {
	Meta
	Unique() [][]string
	// contains filtered or unexported methods
}

type HasUnits

type HasUnits interface {
	Units() string
	// contains filtered or unexported methods
}

type HasWhen

type HasWhen interface {
	When() *When
	// contains filtered or unexported methods
}

type Identifiable

type Identifiable interface {

	// Ident is short for identifier or name of item.  Example: 'leaf foo {...' then 'foo' is ident
	Ident() string
}

Identifiable are things that have a unique identifier allowing it to be found in a list.

type Identity

type Identity struct {
	// contains filtered or unexported fields
}

func (*Identity) Base

func (y *Identity) Base() []*Identity

func (*Identity) BaseIds

func (y *Identity) BaseIds() []string

func (*Identity) Derived

func (y *Identity) Derived() map[string]*Identity

func (*Identity) DerivedDirect

func (y *Identity) DerivedDirect() []*Identity

func (*Identity) Description

func (m *Identity) Description() string

Description of Identity

func (*Identity) Extensions

func (m *Identity) Extensions() []*Extension

func (*Identity) Ident

func (m *Identity) Ident() string

Ident is identity of Identity

func (*Identity) IfFeatures

func (m *Identity) IfFeatures() []*IfFeature

func (*Identity) Parent

func (m *Identity) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Identity) Reference

func (m *Identity) Reference() string

type IfFeature

type IfFeature struct {
	// contains filtered or unexported fields
}

func (*IfFeature) Evaluate

func (y *IfFeature) Evaluate(enabled map[string]*Feature) (bool, error)

func (*IfFeature) Expression

func (y *IfFeature) Expression() string

func (*IfFeature) Extensions

func (m *IfFeature) Extensions() []*Extension

func (*IfFeature) Parent

func (m *IfFeature) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

type Import

type Import struct {
	// contains filtered or unexported fields
}

func (*Import) Description

func (m *Import) Description() string

Description of Import

func (*Import) Extensions

func (m *Import) Extensions() []*Extension

func (*Import) Module

func (y *Import) Module() *Module

func (*Import) Parent

func (m *Import) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Import) Prefix

func (y *Import) Prefix() string

func (*Import) Reference

func (m *Import) Reference() string

func (*Import) RevisionDate

func (y *Import) RevisionDate() string

type Include

type Include struct {
	// contains filtered or unexported fields
}

func (*Include) Description

func (m *Include) Description() string

Description of Include

func (*Include) Extensions

func (m *Include) Extensions() []*Extension

func (*Include) Parent

func (m *Include) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Include) Reference

func (m *Include) Reference() string

func (*Include) Revision

func (y *Include) Revision() *Revision

func (*Include) RevisionDate

func (y *Include) RevisionDate() string

type Leaf

type Leaf struct {
	// contains filtered or unexported fields
}

func (*Leaf) Config

func (m *Leaf) Config() bool

func (*Leaf) Default

func (m *Leaf) Default() string

func (*Leaf) DefaultValue

func (m *Leaf) DefaultValue() interface{}

func (*Leaf) Description

func (m *Leaf) Description() string

Description of Leaf

func (*Leaf) Extensions

func (m *Leaf) Extensions() []*Extension

func (*Leaf) HasDefault

func (m *Leaf) HasDefault() bool

func (*Leaf) Ident

func (m *Leaf) Ident() string

Ident is identity of Leaf

func (*Leaf) IfFeatures

func (m *Leaf) IfFeatures() []*IfFeature

func (*Leaf) IsConfigSet

func (m *Leaf) IsConfigSet() bool

func (*Leaf) IsMandatorySet

func (m *Leaf) IsMandatorySet() bool

func (*Leaf) Mandatory

func (m *Leaf) Mandatory() bool

func (*Leaf) Musts

func (m *Leaf) Musts() []*Must

func (*Leaf) Parent

func (m *Leaf) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Leaf) Reference

func (m *Leaf) Reference() string

func (*Leaf) Type

func (m *Leaf) Type() *Type

func (*Leaf) Units

func (m *Leaf) Units() string

func (*Leaf) When

func (m *Leaf) When() *When

type LeafList

type LeafList struct {
	// contains filtered or unexported fields
}

func (*LeafList) Config

func (m *LeafList) Config() bool

func (*LeafList) Default

func (m *LeafList) Default() []string

func (*LeafList) DefaultValue

func (m *LeafList) DefaultValue() interface{}

func (*LeafList) Description

func (m *LeafList) Description() string

Description of LeafList

func (*LeafList) Extensions

func (m *LeafList) Extensions() []*Extension

func (*LeafList) HasDefault

func (m *LeafList) HasDefault() bool

func (*LeafList) Ident

func (m *LeafList) Ident() string

Ident is identity of LeafList

func (*LeafList) IfFeatures

func (m *LeafList) IfFeatures() []*IfFeature

func (*LeafList) IsConfigSet

func (m *LeafList) IsConfigSet() bool

func (*LeafList) IsMandatorySet

func (m *LeafList) IsMandatorySet() bool

func (*LeafList) IsMaxElementsSet

func (m *LeafList) IsMaxElementsSet() bool

func (*LeafList) IsMinElementsSet

func (m *LeafList) IsMinElementsSet() bool

func (*LeafList) IsUnboundedSet

func (m *LeafList) IsUnboundedSet() bool

func (*LeafList) Mandatory

func (m *LeafList) Mandatory() bool

func (*LeafList) MaxElements

func (m *LeafList) MaxElements() int

MaxElements return 0 when unbounded

func (*LeafList) MinElements

func (m *LeafList) MinElements() int

func (*LeafList) Musts

func (m *LeafList) Musts() []*Must

func (*LeafList) OrderedBy

func (m *LeafList) OrderedBy() OrderedBy

func (*LeafList) Parent

func (m *LeafList) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*LeafList) Reference

func (m *LeafList) Reference() string

func (*LeafList) Type

func (m *LeafList) Type() *Type

func (*LeafList) Unbounded

func (m *LeafList) Unbounded() bool

func (*LeafList) Units

func (m *LeafList) Units() string

func (*LeafList) When

func (m *LeafList) When() *When

type Leafable

type Leafable interface {
	Definition
	HasDefault
	HasUnits
	HasType
}

type List

type List struct {
	// contains filtered or unexported fields
}

func (*List) Actions

func (m *List) Actions() map[string]*Rpc

func (*List) Config

func (m *List) Config() bool

func (*List) DataDefinition

func (m *List) DataDefinition(ident string) Definition

func (*List) DataDefinitions

func (m *List) DataDefinitions() []Definition

func (*List) Definition

func (m *List) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*List) Description

func (m *List) Description() string

Description of List

func (*List) Extensions

func (m *List) Extensions() []*Extension

func (*List) Groupings

func (m *List) Groupings() map[string]*Grouping

func (*List) Ident

func (m *List) Ident() string

Ident is identity of List

func (*List) IfFeatures

func (m *List) IfFeatures() []*IfFeature

func (*List) IsConfigSet

func (m *List) IsConfigSet() bool

func (*List) IsMandatorySet

func (m *List) IsMandatorySet() bool

func (*List) IsMaxElementsSet

func (m *List) IsMaxElementsSet() bool

func (*List) IsMinElementsSet

func (m *List) IsMinElementsSet() bool

func (*List) IsRecursive

func (m *List) IsRecursive() bool

func (*List) IsUnboundedSet

func (m *List) IsUnboundedSet() bool

func (*List) KeyMeta

func (y *List) KeyMeta() (keyMeta []Leafable)

func (*List) Mandatory

func (m *List) Mandatory() bool

func (*List) MaxElements

func (m *List) MaxElements() int

MaxElements return 0 when unbounded

func (*List) MinElements

func (m *List) MinElements() int

func (*List) Musts

func (m *List) Musts() []*Must

func (*List) Notifications

func (m *List) Notifications() map[string]*Notification

func (*List) OrderedBy

func (m *List) OrderedBy() OrderedBy

func (*List) Parent

func (m *List) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*List) Reference

func (m *List) Reference() string

func (*List) Typedefs

func (m *List) Typedefs() map[string]*Typedef

func (*List) Unbounded

func (m *List) Unbounded() bool

func (*List) Unique

func (m *List) Unique() [][]string

Unique is list of fields (or compound fields) that must be unque in the list of items. If there is a key listed, that is implicitly unique and would not be listed here.

func (*List) When

func (m *List) When() *When

type Loader

type Loader func(parent *Module, name string, rev string, features FeatureSet, loader Loader) (*Module, error)

Loader abstracts yang modules are loaded from file parsers.

type Meta

type Meta interface {
	HasExtensions

	// Parent in the YANG schema tree
	Parent() Meta
}

///////////////// Interfaces //////////////// Definition represent nearly everythihng in YANG, more specifically, anything that can have an extention, which is nearly everything

type MetaPath

type MetaPath struct {
	// contains filtered or unexported fields
}

func (*MetaPath) Meta

func (p *MetaPath) Meta() Definition

func (*MetaPath) MetaParent

func (p *MetaPath) MetaParent() Path

func (*MetaPath) String

func (p *MetaPath) String() string

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is top-most container of the information model. It's name does not appear in data model.

func OriginalModule

func OriginalModule(m Definition) *Module

Module a definition was defined in, not the module it ended up in. this is useful for resolving typedefs and uses

func RootModule

func RootModule(m Meta) *Module

RootModule finds root meta definition, which is the Module

func (*Module) Actions

func (m *Module) Actions() map[string]*Rpc

func (*Module) Augments

func (m *Module) Augments() []*Augment

func (*Module) Contact

func (y *Module) Contact() string

func (*Module) DataDefinition

func (m *Module) DataDefinition(ident string) Definition

func (*Module) DataDefinitions

func (m *Module) DataDefinitions() []Definition

func (*Module) Definition

func (m *Module) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*Module) Description

func (m *Module) Description() string

Description of Module

func (*Module) Deviations

func (y *Module) Deviations() []*Deviation

func (*Module) ExtensionDefs

func (y *Module) ExtensionDefs() map[string]*ExtensionDef

func (*Module) Extensions

func (m *Module) Extensions() []*Extension

func (*Module) FeatureSet

func (y *Module) FeatureSet() FeatureSet

func (*Module) Features

func (y *Module) Features() map[string]*Feature

func (*Module) Groupings

func (m *Module) Groupings() map[string]*Grouping

func (*Module) Ident

func (m *Module) Ident() string

This is boilerplate functions generated from ./meta/gen/ package. Do not edit this file, instead edit ./gen/gen.in and run "cd gen && go generate" Ident is identity of Module

func (*Module) Identities

func (y *Module) Identities() map[string]*Identity

func (*Module) Imports

func (y *Module) Imports() map[string]*Import

func (*Module) Includes

func (y *Module) Includes() []*Include

func (*Module) IsRecursive

func (m *Module) IsRecursive() bool

func (*Module) ModuleByPrefix

func (y *Module) ModuleByPrefix(prefix string) (*Module, error)

func (*Module) Namespace

func (y *Module) Namespace() string

func (*Module) Notifications

func (m *Module) Notifications() map[string]*Notification

func (*Module) Organization

func (y *Module) Organization() string

func (*Module) Parent

func (m *Module) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Module) Prefix

func (y *Module) Prefix() string

func (*Module) Reference

func (m *Module) Reference() string

func (*Module) Revision

func (y *Module) Revision() *Revision

func (*Module) RevisionHistory

func (y *Module) RevisionHistory() []*Revision

func (*Module) Revisions

func (y *Module) Revisions() []*Revision

func (*Module) Typedefs

func (m *Module) Typedefs() map[string]*Typedef

func (*Module) Version

func (y *Module) Version() string

type Must

type Must struct {
	// contains filtered or unexported fields
}

func (*Must) Description

func (m *Must) Description() string

Description of Must

func (*Must) ErrorAppTag

func (m *Must) ErrorAppTag() string

func (*Must) ErrorMessage

func (m *Must) ErrorMessage() string

func (*Must) Expression

func (y *Must) Expression() string

func (*Must) Extensions

func (m *Must) Extensions() []*Extension

func (*Must) Parent

func (m *Must) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Must) Reference

func (m *Must) Reference() string

type Notification

type Notification struct {
	// contains filtered or unexported fields
}

func (*Notification) DataDefinition

func (m *Notification) DataDefinition(ident string) Definition

func (*Notification) DataDefinitions

func (m *Notification) DataDefinitions() []Definition

func (*Notification) Definition

func (m *Notification) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*Notification) Description

func (m *Notification) Description() string

Description of Notification

func (*Notification) Extensions

func (m *Notification) Extensions() []*Extension

func (*Notification) Groupings

func (m *Notification) Groupings() map[string]*Grouping

func (*Notification) Ident

func (m *Notification) Ident() string

Ident is identity of Notification

func (*Notification) IfFeatures

func (m *Notification) IfFeatures() []*IfFeature

func (*Notification) IsRecursive

func (m *Notification) IsRecursive() bool

func (*Notification) Parent

func (m *Notification) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Notification) Reference

func (m *Notification) Reference() string

func (*Notification) Typedefs

func (m *Notification) Typedefs() map[string]*Typedef

type OrderedBy

type OrderedBy int

type Path

type Path interface {
	fmt.Stringer
	Meta() Definition
	MetaParent() Path
}

type Pattern

type Pattern struct {
	Pattern string
	// contains filtered or unexported fields
}

Pattern is used to confine string types to specific regular expression values

func (*Pattern) CheckValue

func (p *Pattern) CheckValue(s string) bool

func (*Pattern) Description

func (m *Pattern) Description() string

Description of Pattern

func (*Pattern) ErrorAppTag

func (m *Pattern) ErrorAppTag() string

func (*Pattern) ErrorMessage

func (m *Pattern) ErrorMessage() string

func (*Pattern) Extensions

func (m *Pattern) Extensions() []*Extension

func (*Pattern) Inverted

func (p *Pattern) Inverted() bool

func (*Pattern) Reference

func (m *Pattern) Reference() string

type Range

type Range struct {
	Entries []*RangeEntry
	// contains filtered or unexported fields
}

func (*Range) CheckValue

func (r *Range) CheckValue(v val.Value) error

func (*Range) Description

func (m *Range) Description() string

Description of Range

func (*Range) Empty

func (r *Range) Empty() bool

func (*Range) ErrorAppTag

func (m *Range) ErrorAppTag() string

func (*Range) ErrorMessage

func (m *Range) ErrorMessage() string

func (*Range) Extensions

func (m *Range) Extensions() []*Extension

func (*Range) Reference

func (m *Range) Reference() string

func (*Range) String

func (r *Range) String() string

type RangeEntry

type RangeEntry struct {
	Min   RangeNumber
	Max   RangeNumber
	Exact RangeNumber
}

func (*RangeEntry) CheckValue

func (r *RangeEntry) CheckValue(v val.Value) error

func (*RangeEntry) String

func (r *RangeEntry) String() string

type RangeNumber

type RangeNumber struct {
	// contains filtered or unexported fields
}

func (RangeNumber) Compare

func (n RangeNumber) Compare(v val.Value) (int64, error)

func (RangeNumber) Empty

func (n RangeNumber) Empty() bool

func (RangeNumber) String

func (n RangeNumber) String() string

type Refine

type Refine struct {
	// contains filtered or unexported fields
}

func (*Refine) Config

func (m *Refine) Config() bool

func (*Refine) Default

func (m *Refine) Default() string

func (*Refine) DefaultValue

func (m *Refine) DefaultValue() interface{}

func (*Refine) Description

func (m *Refine) Description() string

Description of Refine

func (*Refine) Extensions

func (m *Refine) Extensions() []*Extension

func (*Refine) HasDefault

func (m *Refine) HasDefault() bool

func (*Refine) Ident

func (m *Refine) Ident() string

Ident is identity of Refine

func (*Refine) IfFeatures

func (m *Refine) IfFeatures() []*IfFeature

func (*Refine) IsConfigSet

func (m *Refine) IsConfigSet() bool

func (*Refine) IsMandatorySet

func (m *Refine) IsMandatorySet() bool

func (*Refine) IsMaxElementsSet

func (m *Refine) IsMaxElementsSet() bool

func (*Refine) IsMinElementsSet

func (m *Refine) IsMinElementsSet() bool

func (*Refine) IsUnboundedSet

func (m *Refine) IsUnboundedSet() bool

func (*Refine) Mandatory

func (m *Refine) Mandatory() bool

func (*Refine) MaxElements

func (m *Refine) MaxElements() int

MaxElements return 0 when unbounded

func (*Refine) MinElements

func (m *Refine) MinElements() int

func (*Refine) Musts

func (m *Refine) Musts() []*Must

func (*Refine) Parent

func (m *Refine) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Refine) Presence

func (m *Refine) Presence() string

Presence describes what the existance of this container in the data model means. https://tools.ietf.org/html/rfc7950#section-7.5.1

func (*Refine) Reference

func (m *Refine) Reference() string

func (*Refine) Unbounded

func (m *Refine) Unbounded() bool

type ReplaceDeviate

type ReplaceDeviate struct {
	// contains filtered or unexported fields
}

func (*ReplaceDeviate) Config

func (m *ReplaceDeviate) Config() bool

func (*ReplaceDeviate) Default

func (m *ReplaceDeviate) Default() []string

func (*ReplaceDeviate) DefaultValue

func (m *ReplaceDeviate) DefaultValue() interface{}

func (*ReplaceDeviate) Extensions

func (m *ReplaceDeviate) Extensions() []*Extension

func (*ReplaceDeviate) HasDefault

func (m *ReplaceDeviate) HasDefault() bool

func (*ReplaceDeviate) IsConfigSet

func (m *ReplaceDeviate) IsConfigSet() bool

func (*ReplaceDeviate) IsMandatorySet

func (m *ReplaceDeviate) IsMandatorySet() bool

func (*ReplaceDeviate) IsMaxElementsSet

func (m *ReplaceDeviate) IsMaxElementsSet() bool

func (*ReplaceDeviate) IsMinElementsSet

func (m *ReplaceDeviate) IsMinElementsSet() bool

func (*ReplaceDeviate) Mandatory

func (m *ReplaceDeviate) Mandatory() bool

func (*ReplaceDeviate) MaxElements

func (m *ReplaceDeviate) MaxElements() int

MaxElements return 0 when unbounded

func (*ReplaceDeviate) MinElements

func (m *ReplaceDeviate) MinElements() int

func (*ReplaceDeviate) Parent

func (m *ReplaceDeviate) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*ReplaceDeviate) Type

func (m *ReplaceDeviate) Type() *Type

func (*ReplaceDeviate) Units

func (m *ReplaceDeviate) Units() string

type Revision

type Revision struct {
	// contains filtered or unexported fields
}

Revision is like a version for a module. Format is YYYY-MM-DD and should match the name of the file on disk when multiple revisions of a file exisits.

func (*Revision) Description

func (m *Revision) Description() string

Description of Revision

func (*Revision) Extensions

func (m *Revision) Extensions() []*Extension

func (*Revision) Ident

func (m *Revision) Ident() string

Ident is identity of Revision

func (*Revision) Parent

func (m *Revision) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Revision) Reference

func (m *Revision) Reference() string

type Rpc

type Rpc struct {
	// contains filtered or unexported fields
}

func (*Rpc) Description

func (m *Rpc) Description() string

Description of Rpc

func (*Rpc) Extensions

func (m *Rpc) Extensions() []*Extension

func (*Rpc) Groupings

func (m *Rpc) Groupings() map[string]*Grouping

func (*Rpc) Ident

func (m *Rpc) Ident() string

Ident is identity of Rpc

func (*Rpc) IfFeatures

func (m *Rpc) IfFeatures() []*IfFeature

func (*Rpc) Input

func (y *Rpc) Input() *RpcInput

func (*Rpc) Output

func (y *Rpc) Output() *RpcOutput

func (*Rpc) Parent

func (m *Rpc) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Rpc) Reference

func (m *Rpc) Reference() string

func (*Rpc) Typedefs

func (m *Rpc) Typedefs() map[string]*Typedef

type RpcInput

type RpcInput struct {
	// contains filtered or unexported fields
}

func (*RpcInput) DataDefinition

func (m *RpcInput) DataDefinition(ident string) Definition

func (*RpcInput) DataDefinitions

func (m *RpcInput) DataDefinitions() []Definition

func (*RpcInput) Definition

func (m *RpcInput) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*RpcInput) Description

func (m *RpcInput) Description() string

Description of RpcInput

func (*RpcInput) Extensions

func (m *RpcInput) Extensions() []*Extension

func (*RpcInput) Groupings

func (m *RpcInput) Groupings() map[string]*Grouping

func (*RpcInput) Ident

func (y *RpcInput) Ident() string

func (*RpcInput) IfFeatures

func (m *RpcInput) IfFeatures() []*IfFeature

func (*RpcInput) IsRecursive

func (m *RpcInput) IsRecursive() bool

func (*RpcInput) Musts

func (m *RpcInput) Musts() []*Must

func (*RpcInput) Parent

func (m *RpcInput) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*RpcInput) Reference

func (m *RpcInput) Reference() string

func (*RpcInput) Typedefs

func (m *RpcInput) Typedefs() map[string]*Typedef

type RpcOutput

type RpcOutput struct {
	// contains filtered or unexported fields
}

func (*RpcOutput) DataDefinition

func (m *RpcOutput) DataDefinition(ident string) Definition

func (*RpcOutput) DataDefinitions

func (m *RpcOutput) DataDefinitions() []Definition

func (*RpcOutput) Definition

func (m *RpcOutput) Definition(ident string) Definition

Definition can be a data defintion, action or notification

func (*RpcOutput) Description

func (m *RpcOutput) Description() string

Description of RpcOutput

func (*RpcOutput) Extensions

func (m *RpcOutput) Extensions() []*Extension

func (*RpcOutput) Groupings

func (m *RpcOutput) Groupings() map[string]*Grouping

func (*RpcOutput) Ident

func (y *RpcOutput) Ident() string

func (*RpcOutput) IfFeatures

func (m *RpcOutput) IfFeatures() []*IfFeature

func (*RpcOutput) IsRecursive

func (m *RpcOutput) IsRecursive() bool

func (*RpcOutput) Musts

func (m *RpcOutput) Musts() []*Must

func (*RpcOutput) Parent

func (m *RpcOutput) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*RpcOutput) Reference

func (m *RpcOutput) Reference() string

func (*RpcOutput) Typedefs

func (m *RpcOutput) Typedefs() map[string]*Typedef

type Status

type Status int

Status is indication of definition obsolense

const (
	Current Status = iota
	Deprecated
	Obsolete
)

type Type

type Type struct {
	// contains filtered or unexported fields
}

func (*Type) Base

func (y *Type) Base() *Identity

func (*Type) Bits

func (y *Type) Bits() []*Bit

func (*Type) Description

func (m *Type) Description() string

Description of Type

func (*Type) Enum

func (y *Type) Enum() val.EnumList

func (*Type) Enums

func (y *Type) Enums() []*Enum

func (*Type) Extensions

func (m *Type) Extensions() []*Extension

func (*Type) Format

func (y *Type) Format() val.Format

func (*Type) FractionDigits

func (y *Type) FractionDigits() int

func (*Type) Ident

func (m *Type) Ident() string

Ident is identity of Type

func (*Type) Length

func (y *Type) Length() []*Range

func (*Type) Path

func (y *Type) Path() string

func (*Type) Patterns

func (y *Type) Patterns() []*Pattern

func (*Type) Range

func (y *Type) Range() []*Range

func (*Type) Reference

func (m *Type) Reference() string

func (*Type) RequireInstance

func (y *Type) RequireInstance() bool

func (*Type) Resolve

func (y *Type) Resolve() *Type

Resolve is the effective datatype if this type points to a different dataType, which is the case for leafRefs. Otherwise this just returns itself

func (*Type) Union

func (y *Type) Union() []*Type

func (*Type) UnionFormats

func (y *Type) UnionFormats() []val.Format

type Typedef

type Typedef struct {
	// contains filtered or unexported fields
}

func (*Typedef) Default

func (m *Typedef) Default() string

func (*Typedef) DefaultValue

func (m *Typedef) DefaultValue() interface{}

func (*Typedef) Description

func (m *Typedef) Description() string

Description of Typedef

func (*Typedef) Extensions

func (m *Typedef) Extensions() []*Extension

func (*Typedef) HasDefault

func (m *Typedef) HasDefault() bool

func (*Typedef) Ident

func (m *Typedef) Ident() string

Ident is identity of Typedef

func (*Typedef) Parent

func (m *Typedef) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Typedef) Reference

func (m *Typedef) Reference() string

func (*Typedef) Type

func (m *Typedef) Type() *Type

func (*Typedef) Units

func (m *Typedef) Units() string

type Uses

type Uses struct {
	// contains filtered or unexported fields
}

func (*Uses) Augments

func (m *Uses) Augments() []*Augment

func (*Uses) Description

func (m *Uses) Description() string

Description of Uses

func (*Uses) Extensions

func (m *Uses) Extensions() []*Extension

func (*Uses) Ident

func (m *Uses) Ident() string

Ident is identity of Uses

func (*Uses) IfFeatures

func (m *Uses) IfFeatures() []*IfFeature

func (*Uses) Parent

func (m *Uses) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*Uses) Reference

func (m *Uses) Reference() string

func (*Uses) Refinements

func (y *Uses) Refinements() []*Refine

func (*Uses) When

func (m *Uses) When() *When

type When

type When struct {
	// contains filtered or unexported fields
}

func (*When) Description

func (m *When) Description() string

Description of When

func (*When) Expression

func (y *When) Expression() string

func (*When) Extensions

func (m *When) Extensions() []*Extension

func (*When) Parent

func (m *When) Parent() Meta

Parent is where this extension is define unless the extension is a secondary extension like a description and then this is the parent of that description

func (*When) Reference

func (m *When) Reference() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL