testutil

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GNMIPath

func GNMIPath(t testing.TB, s string) *gpb.Path

mustPath converts a string to its path proto.

func GetSchemaStruct

func GetSchemaStruct() func() *ytypes.Schema

Types

type Device

type Device struct {
	SuperContainer *SuperContainer `path:"super-container" module:"yang-module"`
}

Device is the fake root.

func (*Device) IsYANGGoStruct

func (*Device) IsYANGGoStruct()

func (*Device) Validate

func (*Device) Validate(opts ...ygot.ValidationOption) error

func (*Device) ΛBelongingModule

func (*Device) ΛBelongingModule() string

func (*Device) ΛEnumTypeMap

func (*Device) ΛEnumTypeMap() map[string][]reflect.Type

type EnumType

type EnumType int64

EnumType is used as an enum type in various tests in the ytypes package.

func (EnumType) IsYANGGoEnum

func (EnumType) IsYANGGoEnum()

func (EnumType) String

func (e EnumType) String() string

func (EnumType) ΛMap

func (EnumType) ΛMap() map[string]map[int64]ygot.EnumDefinition

type EnumType2

type EnumType2 int64

EnumType2 is used as an enum type in various tests in the ytypes package.

func (EnumType2) IsYANGGoEnum

func (EnumType2) IsYANGGoEnum()

func (EnumType2) ΛMap

func (EnumType2) ΛMap() map[string]map[int64]ygot.EnumDefinition

type LeafContainerStruct

type LeafContainerStruct struct {
	Uint64Leaf          *uint64       `path:"uint64-leaf" shadow-path:"state/uint64-leaf"`
	EnumLeaf            EnumType      `path:"enum-leaf"`
	UnionLeaf           UnionLeafType `path:"union-leaf"`
	UnionLeaf2          EnumType      `path:"union-leaf2"`
	UnionLeafSingleType []string      `path:"union-stleaflist"`
}

func (*LeafContainerStruct) IsYANGGoStruct

func (*LeafContainerStruct) IsYANGGoStruct()

func (*LeafContainerStruct) To_UnionLeafType

func (*LeafContainerStruct) To_UnionLeafType(i interface{}) (UnionLeafType, error)

func (*LeafContainerStruct) Validate

func (*LeafContainerStruct) Validate(opts ...ygot.ValidationOption) error

func (*LeafContainerStruct) ΛBelongingModule

func (*LeafContainerStruct) ΛBelongingModule() string

func (*LeafContainerStruct) ΛEnumTypeMap

func (*LeafContainerStruct) ΛEnumTypeMap() map[string][]reflect.Type

type Model

type Model struct {
	SingleKey map[int32]*Model_SingleKey `path:"a/single-key"`
}

func (*Model) IsYANGGoStruct

func (*Model) IsYANGGoStruct()

func (*Model) NewSingleKey

func (t *Model) NewSingleKey(Key int32) (*Model_SingleKey, error)

NewSingleKey is a *generated* method for Model which may be used by an unmarshal function in ytype's reflect library, and is kept here in case.

func (*Model) RenameSingleKey

func (t *Model) RenameSingleKey(oldK, newK int32) error

RenameSingleKey is a *generated* method for Model which may be used by an unmarshal function in ytype's reflect library, and is kept here in case. RenameSingleKey renames an entry in the list SingleKey within the Model struct. The entry with key oldK is renamed to newK updating the key within the value.

func (*Model) Validate

func (*Model) Validate(opts ...ygot.ValidationOption) error

func (*Model) ΛBelongingModule

func (*Model) ΛBelongingModule() string

func (*Model) ΛEnumTypeMap

func (*Model) ΛEnumTypeMap() map[string][]reflect.Type

type Model_SingleKey

type Model_SingleKey struct {
	Key   *int32 `path:"config/key|key" shadow-path:"state/key"`
	Value *int64 `path:"config/value" shadow-path:"state/value"`
}

func (*Model_SingleKey) IsYANGGoStruct

func (*Model_SingleKey) IsYANGGoStruct()

func (*Model_SingleKey) Validate

func (*Model_SingleKey) Validate(opts ...ygot.ValidationOption) error

func (*Model_SingleKey) ΛBelongingModule

func (*Model_SingleKey) ΛBelongingModule() string

func (*Model_SingleKey) ΛEnumTypeMap

func (*Model_SingleKey) ΛEnumTypeMap() map[string][]reflect.Type

func (*Model_SingleKey) ΛListKeyMap

func (t *Model_SingleKey) ΛListKeyMap() (map[string]interface{}, error)

ΛListKeyMap returns the keys of the Model_SingleKey struct, which is a YANG list entry.

type SuperContainer

type SuperContainer struct {
	LeafContainerStruct *LeafContainerStruct `path:"leaf-container-struct"`
	Model               *Model               `path:"model"`
}

func (*SuperContainer) IsYANGGoStruct

func (*SuperContainer) IsYANGGoStruct()

func (*SuperContainer) Validate

func (*SuperContainer) Validate(opts ...ygot.ValidationOption) error

func (*SuperContainer) ΛBelongingModule

func (*SuperContainer) ΛBelongingModule() string

func (*SuperContainer) ΛEnumTypeMap

func (*SuperContainer) ΛEnumTypeMap() map[string][]reflect.Type

type UnionLeafType

type UnionLeafType interface {
	Is_UnionLeafType()
}

type UnionLeafType_EnumType

type UnionLeafType_EnumType struct {
	EnumType EnumType
}

func (*UnionLeafType_EnumType) Is_UnionLeafType

func (*UnionLeafType_EnumType) Is_UnionLeafType()

func (*UnionLeafType_EnumType) ΛMap

type UnionLeafType_EnumType2

type UnionLeafType_EnumType2 struct {
	EnumType2 EnumType2
}

func (*UnionLeafType_EnumType2) Is_UnionLeafType

func (*UnionLeafType_EnumType2) Is_UnionLeafType()

func (*UnionLeafType_EnumType2) ΛMap

type UnionLeafType_String

type UnionLeafType_String struct {
	String string
}

func (*UnionLeafType_String) Is_UnionLeafType

func (*UnionLeafType_String) Is_UnionLeafType()

type UnionLeafType_Uint32

type UnionLeafType_Uint32 struct {
	Uint32 uint32
}

func (*UnionLeafType_Uint32) Is_UnionLeafType

func (*UnionLeafType_Uint32) Is_UnionLeafType()

Jump to

Keyboard shortcuts

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