Documentation ¶
Overview ¶
Package types provides built-in types specified in YANG RFC 6020 and types used in YDK Go APIs.
YANG Development Kit Copyright 2017 Cisco Systems. All rights reserved. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func AddKeyToken(attr interface{}, attrName string) string
- func AddNoKeyToken(ent Entity) string
- func EntityDiff(ent1 Entity, ent2 Entity) map[string]StringPair
- func EntityEqual(x, y Entity) bool
- func EntityToDict(entity Entity) map[string]string
- func EntityToString(e Entity) string
- func GetAbsolutePath(entity Entity) string
- func GetEntityFilter(ent Entity) yfilter.YFilter
- func GetPresenceFlag(entity Entity) bool
- func GetRelativeEntityPath(current_node Entity, ancestor Entity, path string) string
- func GetSegmentPath(entity Entity) string
- func GetYChildrenMap(entity Entity) map[string]YChild
- func HasDataOrFilter(entity Entity) bool
- func IsEntityCollection(e Entity) bool
- func IsPresenceContainer(entity Entity) bool
- func IsSet(Filter yfilter.YFilter) bool
- func IsTopLevelEntity(entity Entity) bool
- func SetAllParents(entity Entity)
- func SetEntityFilter(ent Entity, filter yfilter.YFilter)
- func SetNontopEntityFilter(entity Entity, filter yfilter.YFilter)
- func SetParent(entity, parent Entity)
- func SetPresenceFlag(entity Entity)
- func SetValue(entity Entity, valuePath string, value interface{})
- func SetYListKey(ent Entity, index int)
- type Bits
- type BitsList
- type COpenDaylightServiceProvider
- type CServiceProvider
- type CodecServiceProvider
- type CommonEntityData
- type Config
- type DataNode
- type Decimal64
- type Empty
- type Entity
- type EntityCollection
- func (ec *EntityCollection) Add(entities ...Entity)
- func (ec *EntityCollection) Append(entities []Entity)
- func (ec *EntityCollection) Clear()
- func (ec *EntityCollection) Entities() []Entity
- func (ec *EntityCollection) Get(key string) (Entity, bool)
- func (ec EntityCollection) GetEntityData() *CommonEntityData
- func (ec *EntityCollection) GetItem(item int) Entity
- func (ec *EntityCollection) HasKey(key string) bool
- func (ec *EntityCollection) Keys() []string
- func (ec *EntityCollection) Len() int
- func (ec *EntityCollection) Pop(key string) (Entity, bool)
- func (ec *EntityCollection) SetFilter(filter yfilter.YFilter)
- func (ec *EntityCollection) String() string
- type EntityPath
- type EntitySlice
- type Enum
- type EnumYLeaf
- type Filter
- type LeafData
- type NameLeafData
- type OrderedMap
- func (om *OrderedMap) Append(key string, value interface{})
- func (om *OrderedMap) Get(key string) (interface{}, bool)
- func (om *OrderedMap) Keys() []string
- func (om *OrderedMap) Len() int
- func (om *OrderedMap) Map() map[string]interface{}
- func (om *OrderedMap) Pop(key string) (interface{}, bool)
- func (om *OrderedMap) Values() []interface{}
- type Repository
- type RootSchemaNode
- type Rpc
- type ServiceProvider
- type Session
- type StringPair
- type YChild
- type YLeaf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKeyToken ¶
func AddNoKeyToken ¶
func EntityDiff ¶
func EntityDiff(ent1 Entity, ent2 Entity) map[string]StringPair
func EntityEqual ¶
EntityEqual returns whether the entities x and y and their children are equal in value
func EntityToDict ¶
func EntityToString ¶
func GetAbsolutePath ¶
func GetEntityFilter ¶
func GetPresenceFlag ¶
GetPresenceFlag returns whether the presence flag of the given entity is set or not if it is a presence container
func GetRelativeEntityPath ¶
GetRelativeEntityPath returns the relative entity path (string)
func GetSegmentPath ¶
GetSegmentPath returns the given entity's segment path
func GetYChildrenMap ¶
func HasDataOrFilter ¶
HasDataOrFilter returns a bool representing whether the entity or any of its children have their data/filter set
func IsEntityCollection ¶
func IsPresenceContainer ¶
IsPresenceContainer returns if the given entity is a presence container
func IsTopLevelEntity ¶
func SetAllParents ¶
func SetAllParents(entity Entity)
Set Parent values in all children recursively
func SetEntityFilter ¶
func SetNontopEntityFilter ¶
func SetParent ¶
func SetParent(entity, parent Entity)
SetParent sets the given entity's parent to the given parent entity
func SetPresenceFlag ¶
func SetPresenceFlag(entity Entity)
SetPresenceFlag sets the presence flag of the given entity if it is a presence container
func SetYListKey ¶
Types ¶
type COpenDaylightServiceProvider ¶
type COpenDaylightServiceProvider struct {
Private interface{}
}
COpenDaylightServiceProvider is a service provider to be used to communicate with an OpenDaylight instance.
type CodecServiceProvider ¶
type CodecServiceProvider interface { Initialize(Entity) GetEncoding() encoding.EncodingFormat GetRootSchemaNode(Entity) RootSchemaNode GetState() *errors.State }
CodecServiceProvider
type CommonEntityData ¶
type CommonEntityData struct { // static data (internals) YangName string BundleName string ParentYangName string YFilter yfilter.YFilter Children *OrderedMap Leafs *OrderedMap SegmentPath string AbsolutePath string CapabilitiesTable map[string]string NamespaceTable map[string]string BundleYangModelsLocation string YListKeys []string // dynamic data (internals) Parent Entity }
CommonEntityData encapsulate common data within an Entity
type Config ¶
type Config = EntityCollection
type DataNode ¶
type DataNode struct {
Private interface{}
}
DataNode represents a containment hierarchy
type Decimal64 ¶
type Decimal64 struct {
// contains filtered or unexported fields
}
Decimal64 represents a YANG built-in Decimal64 type
type Entity ¶
type Entity interface {
GetEntityData() *CommonEntityData
}
Entity is a basic type that represents containers in YANG
func GetChildByName ¶
GetChildByName takes an Entity and returns the child Entity described by the given childYangName and segmentPath or nil if there is no match
func PathToEntity ¶
type EntityCollection ¶
type EntityCollection struct {
EcMap *OrderedMap
}
EntityCollection definition and methods
func EntityToCollection ¶
func EntityToCollection(e Entity) *EntityCollection
func NewEntityCollection ¶
func NewEntityCollection(entities ...Entity) EntityCollection
func (*EntityCollection) Add ¶
func (ec *EntityCollection) Add(entities ...Entity)
func (*EntityCollection) Append ¶
func (ec *EntityCollection) Append(entities []Entity)
func (*EntityCollection) Clear ¶
func (ec *EntityCollection) Clear()
func (*EntityCollection) Entities ¶
func (ec *EntityCollection) Entities() []Entity
func (EntityCollection) GetEntityData ¶
func (ec EntityCollection) GetEntityData() *CommonEntityData
Implementing Entity interface
func (*EntityCollection) GetItem ¶
func (ec *EntityCollection) GetItem(item int) Entity
func (*EntityCollection) HasKey ¶
func (ec *EntityCollection) HasKey(key string) bool
func (*EntityCollection) Keys ¶
func (ec *EntityCollection) Keys() []string
func (*EntityCollection) Len ¶
func (ec *EntityCollection) Len() int
func (*EntityCollection) SetFilter ¶
func (ec *EntityCollection) SetFilter(filter yfilter.YFilter)
func (*EntityCollection) String ¶
func (ec *EntityCollection) String() string
type EntityPath ¶
type EntityPath struct { Path string ValuePaths []NameLeafData }
EntityPath
func GetEntityPath ¶
func GetEntityPath(entity Entity) EntityPath
GetEntityPath returns an EntityPath struct for the given entity
type EntitySlice ¶
type EntitySlice []Entity
EntitySlice is a slice of entities
func (EntitySlice) Less ¶
func (s EntitySlice) Less(i, j int) bool
Less returns whether the Entity at index i is less than the one at index j of the given EntitySlice
func (EntitySlice) Swap ¶
func (s EntitySlice) Swap(i, j int)
Swap swaps the Entities at indices i and j of the given EntitySlice
type Enum ¶
type Enum struct {
EnumYLeaf
}
Enum represents a YANG built-in enum type, a base type for all YDK enums.
type EnumYLeaf ¶
type EnumYLeaf struct {
// contains filtered or unexported fields
}
EnumYLeaf represents variable data
type Filter ¶
type Filter = EntityCollection
type NameLeafData ¶
NameLeafData represents a YANG leaf to which a name and data can be assigned
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
Ordered Map
func NewOrderedMap ¶
func NewOrderedMap() *OrderedMap
func (*OrderedMap) Append ¶
func (om *OrderedMap) Append(key string, value interface{})
func (*OrderedMap) Get ¶
func (om *OrderedMap) Get(key string) (interface{}, bool)
func (*OrderedMap) Keys ¶
func (om *OrderedMap) Keys() []string
func (*OrderedMap) Len ¶
func (om *OrderedMap) Len() int
func (*OrderedMap) Map ¶
func (om *OrderedMap) Map() map[string]interface{}
func (*OrderedMap) Pop ¶
func (om *OrderedMap) Pop(key string) (interface{}, bool)
func (*OrderedMap) Values ¶
func (om *OrderedMap) Values() []interface{}
type Repository ¶
type Repository struct { Path string Private interface{} }
Repository represents the Repository of YANG models. A instance of the Repository will be used to create a RootSchemaNode given a set of ©pabilities. Behind the scenes the repository is responsible for loading and parsing the YANG modules and creating the SchemaNode tree.
type RootSchemaNode ¶
type RootSchemaNode struct {
Private interface{}
}
RootSchemaNode represents the root of the SchemaTree. It can be used to instantiate a DataNode tree or an Rpc object. The children of the RootSchemaNode represent the top level SchemaNode in the YANG module submodules.
type ServiceProvider ¶
type ServiceProvider interface { GetPrivate() interface{} Connect() Disconnect() GetState() *errors.State ExecuteRpc(string, Entity, map[string]string) DataNode }
ServiceProvider
type StringPair ¶
type YChild ¶
YChild encapsulates the GoName of an entity as well as the entity itself
func GetYChildren ¶
func GetYChildren(entityData *CommonEntityData) []YChild
Directories ¶
Path | Synopsis |
---|---|
Package datastore provides support for the DataStore type.
|
Package datastore provides support for the DataStore type. |
Package encodingformat provides support for the EncodingFormat type.
|
Package encodingformat provides support for the EncodingFormat type. |
Package protocol provides support for the Protocol type.
|
Package protocol provides support for the Protocol type. |
Package yfilter can be used to include the various operations supported in the Netconf protocol’s edit-config RPC in your YDK app.
|
Package yfilter can be used to include the various operations supported in the Netconf protocol’s edit-config RPC in your YDK app. |
Package types provides built-in types specified in YANG RFC 6020 and types used in YDK Go APIs.
|
Package types provides built-in types specified in YANG RFC 6020 and types used in YDK Go APIs. |
Package ytype provides support for YANG builtin types.
|
Package ytype provides support for YANG builtin types. |