Documentation
¶
Index ¶
- Constants
- func AddXMLOperation(elem *etree.Element, operation XMLOperation, operationWithNamespace bool, ...)
- func BoolPtr(b bool) *bool
- func Convert(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertBinary(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertBits(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertBoolean(value string, _ *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertDecimal64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertEnumeration(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertIdentityRef(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertInstanceIdentifier(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertInt16(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertInt32(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertInt64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertInt8(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertJsonValueToTv(d any, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertLeafRef(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertSdcpbNumberToInt64(mm *sdcpb.Number) (int64, error)
- func ConvertSdcpbNumberToUint64(mm *sdcpb.Number) (uint64, error)
- func ConvertString(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertToTypedValue(schemaObject *sdcpb.SchemaElem, v string, ts uint64) (*sdcpb.TypedValue, error)
- func ConvertUint16(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertUint32(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertUint64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertUint8(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func ConvertUnion(value string, slts []*sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
- func FromGNMIPath(pre, p *gnmi.Path) *sdcpb.Path
- func FromGNMITypedValue(v *gnmi.TypedValue) *sdcpb.TypedValue
- func GetJsonValue(tv *sdcpb.TypedValue, ietf bool) (any, error)
- func GetNamespaceFromGetSchema(s *sdcpb.SchemaElem) string
- func GetSchemaElemModuleName(s *sdcpb.SchemaElem) (moduleName string)
- func GetSchemaValue(updValue *sdcpb.TypedValue) (interface{}, error)
- func MapApplyFuncToMap[K comparable, V any, X any](m map[K]V, f func(K, V) X) map[K]X
- func MapToSlice[K comparable, V any, X any](m map[K]V, f func(K, V) X) []X
- func MapToString[K comparable, V any](m map[K]V, sep string, format func(K, V) string) string
- func MapToStringEmptyMessage[K comparable, V any](m map[K]V, sep string, format func(K, V) string, emptyMessage string) string
- func NotificationsEqual(n1, n2 *sdcpb.Notification) bool
- func ParseDecimal64(v string) (*sdcpb.Decimal64, error)
- func SdcpbUpdateToCacheUpdate(upd *sdcpb.Update, owner string, prio int32) (*cache.Update, error)
- func SdcpbUpdatesToCacheUpdates(upds []*sdcpb.Update, owner string, prio int32) ([]*cache.Update, error)
- func ToGNMIPath(p *sdcpb.Path) *gnmi.Path
- func ToGNMITypedValue(v *sdcpb.TypedValue) *gnmi.TypedValue
- func ToSchemaNotification(n *gnmi.Notification) *sdcpb.Notification
- func TypedValueToXML(parent *etree.Element, tv *sdcpb.TypedValue, name string, namespace string, ...)
- func TypedValueToYANGType(tv *sdcpb.TypedValue, schemaObject *sdcpb.SchemaElem) (*sdcpb.TypedValue, error)
- func XMLRegexConvert(s string) string
- func XmlRecursiveSortElementsByTagName(element *etree.Element)
- type Converter
- func (c *Converter) ExpandContainerValue(ctx context.Context, p *sdcpb.Path, jv any, cs *sdcpb.SchemaElem_Container) ([]*sdcpb.Update, error)
- func (c *Converter) ExpandUpdate(ctx context.Context, upd *sdcpb.Update) ([]*sdcpb.Update, error)
- func (c *Converter) ExpandUpdateKeysAsLeaf(ctx context.Context, upd *sdcpb.Update) ([]*sdcpb.Update, error)
- func (c *Converter) ExpandUpdates(ctx context.Context, updates []*sdcpb.Update) ([]*sdcpb.Update, error)
- type SRng
- type SRnges
- type SchemaClientBound
- type URng
- type URnges
- type XMLOperation
Constants ¶
const (
NcBase1_0 = "urn:ietf:params:xml:ns:netconf:base:1.0"
)
Variables ¶
This section is empty.
Functions ¶
func AddXMLOperation ¶ added in v0.0.44
func AddXMLOperation(elem *etree.Element, operation XMLOperation, operationWithNamespace bool, useOperationRemove bool)
AddXMLOperation adds the operation Attribute to the given etree.Element if the operation is XMLOperationDelete or XMLOperationRemove, the useOperationRemove parameter defines which operation of these is finally used. if XMLOperationReplace is providede, the replace operation is addded.
func Convert ¶ added in v0.0.42
func Convert(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertBinary ¶ added in v0.0.42
func ConvertBinary(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertBits ¶ added in v0.0.61
func ConvertBits(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertBoolean ¶ added in v0.0.42
func ConvertBoolean(value string, _ *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertDecimal64 ¶ added in v0.0.42
func ConvertDecimal64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertEnumeration ¶ added in v0.0.42
func ConvertEnumeration(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertIdentityRef ¶ added in v0.0.42
func ConvertIdentityRef(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertInstanceIdentifier ¶ added in v0.0.42
func ConvertInstanceIdentifier(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertInt16 ¶ added in v0.0.42
func ConvertInt16(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertInt32 ¶ added in v0.0.42
func ConvertInt32(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertInt64 ¶ added in v0.0.42
func ConvertInt64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertInt8 ¶ added in v0.0.42
func ConvertInt8(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertJsonValueToTv ¶ added in v0.0.44
func ConvertJsonValueToTv(d any, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertLeafRef ¶ added in v0.0.42
func ConvertLeafRef(value string, slt *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertSdcpbNumberToInt64 ¶ added in v0.0.42
func ConvertSdcpbNumberToUint64 ¶ added in v0.0.42
func ConvertString ¶ added in v0.0.42
func ConvertString(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertToTypedValue ¶ added in v0.0.44
func ConvertToTypedValue(schemaObject *sdcpb.SchemaElem, v string, ts uint64) (*sdcpb.TypedValue, error)
func ConvertUint16 ¶ added in v0.0.42
func ConvertUint16(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertUint32 ¶ added in v0.0.42
func ConvertUint32(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertUint64 ¶ added in v0.0.42
func ConvertUint64(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertUint8 ¶ added in v0.0.42
func ConvertUint8(value string, lst *sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func ConvertUnion ¶ added in v0.0.42
func ConvertUnion(value string, slts []*sdcpb.SchemaLeafType) (*sdcpb.TypedValue, error)
func FromGNMITypedValue ¶
func FromGNMITypedValue(v *gnmi.TypedValue) *sdcpb.TypedValue
func GetJsonValue ¶ added in v0.0.44
func GetJsonValue(tv *sdcpb.TypedValue, ietf bool) (any, error)
func GetNamespaceFromGetSchema ¶ added in v0.0.44
func GetNamespaceFromGetSchema(s *sdcpb.SchemaElem) string
func GetSchemaElemModuleName ¶ added in v0.0.44
func GetSchemaElemModuleName(s *sdcpb.SchemaElem) (moduleName string)
func GetSchemaValue ¶
func GetSchemaValue(updValue *sdcpb.TypedValue) (interface{}, error)
func MapApplyFuncToMap ¶ added in v0.0.64
func MapApplyFuncToMap[K comparable, V any, X any](m map[K]V, f func(K, V) X) map[K]X
func MapToSlice ¶ added in v0.0.64
func MapToSlice[K comparable, V any, X any](m map[K]V, f func(K, V) X) []X
MapToSlice executes a function on all the elements of a map, taking in key and value and returns the collected results in a slice
func MapToString ¶ added in v0.0.63
func MapToString[K comparable, V any](m map[K]V, sep string, format func(K, V) string) string
MapToString converts a map into a string using a formatter function.
func MapToStringEmptyMessage ¶ added in v0.0.63
func MapToStringEmptyMessage[K comparable, V any](m map[K]V, sep string, format func(K, V) string, emptyMessage string) string
MapToStringEmptyMessage converts a map into a string using a formatter function, returning the emptyMessage if the map does not contain entries.
func NotificationsEqual ¶
func NotificationsEqual(n1, n2 *sdcpb.Notification) bool
func SdcpbUpdateToCacheUpdate ¶ added in v0.0.56
func SdcpbUpdatesToCacheUpdates ¶ added in v0.0.56
func ToGNMITypedValue ¶
func ToGNMITypedValue(v *sdcpb.TypedValue) *gnmi.TypedValue
func ToSchemaNotification ¶
func ToSchemaNotification(n *gnmi.Notification) *sdcpb.Notification
func TypedValueToXML ¶ added in v0.0.44
func TypedValueToYANGType ¶ added in v0.0.44
func TypedValueToYANGType(tv *sdcpb.TypedValue, schemaObject *sdcpb.SchemaElem) (*sdcpb.TypedValue, error)
func XMLRegexConvert ¶ added in v0.0.61
func XmlRecursiveSortElementsByTagName ¶ added in v0.0.44
XmlRecursiveSortElementsByTagName - is a function used in testing to recursively sort XML elements by their tag name
Types ¶
type Converter ¶ added in v0.0.44
type Converter struct {
// contains filtered or unexported fields
}
func NewConverter ¶ added in v0.0.44
func NewConverter(scb SchemaClientBound) *Converter
func (*Converter) ExpandContainerValue ¶ added in v0.0.44
func (*Converter) ExpandUpdate ¶ added in v0.0.44
expandUpdate Expands the value, in case of json to single typed value updates
func (*Converter) ExpandUpdateKeysAsLeaf ¶ added in v0.0.44
type SRng ¶ added in v0.0.42
type SRng struct {
// contains filtered or unexported fields
}
urng represents a single unsigned range
type SRnges ¶ added in v0.0.42
type SRnges struct {
// contains filtered or unexported fields
}
urnges represents a collection of rng (range)
func (*SRnges) IsWithinAnyRange ¶ added in v0.0.54
func (*SRnges) IsWithinAnyRangeString ¶ added in v0.0.54
func (r *SRnges) IsWithinAnyRangeString(value string) (*sdcpb.TypedValue, error)
type SchemaClientBound ¶ added in v0.0.44
type SchemaClientBound interface { // GetSchema retrieves the schema for the given path GetSchemaSdcpbPath(ctx context.Context, path *sdcpb.Path) (*sdcpb.GetSchemaResponse, error) // GetSchemaElements retrieves the Schema Elements for all levels of the given path GetSchemaElements(ctx context.Context, p *sdcpb.Path, done chan struct{}) (chan *sdcpb.GetSchemaResponse, error) }
SchemaClientBound provides access to a certain vendor + model + version based schema
type URng ¶ added in v0.0.42
type URng struct {
// contains filtered or unexported fields
}
URng represents a single unsigned range
type URnges ¶ added in v0.0.42
type URnges struct {
// contains filtered or unexported fields
}
URnges represents a collection of rng (range)
func (*URnges) IsWithinAnyRange ¶ added in v0.0.54
func (*URnges) IsWithinAnyRangeString ¶ added in v0.0.54
func (r *URnges) IsWithinAnyRangeString(value string) (*sdcpb.TypedValue, error)
type XMLOperation ¶ added in v0.0.44
type XMLOperation string
const ( XMLOperationDelete XMLOperation = "delete" XMLOperationRemove XMLOperation = "remove" XMLOperationReplace XMLOperation = "replace" )