testdevice_2_0_0

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Code generated by YGOT. DO NOT EDIT.

Package testdevice_2_0_0 is a generated package which contains definitions of structs which represent a YANG schema. The generated schema can be compressed by a series of transformations (compression was false in this case).

This package was generated by /home/scondon/go/src/github.com/openconfig/ygot/genutil/names.go using the following YANG input files:

  • onf-test1@2019-06-10.yang
  • onf-test1-augmented@2020-02-29.yang

Imported modules were sourced from:

  • ../../../onos-helm-charts/config-models/testdevice-2.x/files/yang/...

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemaTree map[string]*yang.Entry
)
View Source
var ΛEnum = map[string]map[int64]ygot.EnumDefinition{
	"E_OnfTest1Identities_MYBASE": {
		1: {Name: "IDTYPE1", DefiningModule: "onf-test1-identities"},
		2: {Name: "IDTYPE2", DefiningModule: "onf-test1-identities"},
	},
	"E_OnfTest1_Cont1A_Cont2D_Chocolate": {
		1: {Name: "dark"},
		2: {Name: "milk"},
		3: {Name: "first-available"},
	},
}

ΛEnum is a map, keyed by the name of the type defined for each enum in the generated Go code, which provides a mapping between the constant int64 value of each value of the enumeration, and the string that is used to represent it in the YANG schema. The map is named ΛEnum in order to avoid clash with any valid YANG identifier.

View Source
var ΛEnumTypes = map[string][]reflect.Type{
	"/cont1a/cont2d/chocolate": []reflect.Type{
		reflect.TypeOf((E_OnfTest1_Cont1A_Cont2D_Chocolate)(0)),
	},
	"/cont1b-state/list2b/leaf3d": []reflect.Type{
		reflect.TypeOf((E_OnfTest1Identities_MYBASE)(0)),
	},
}

ΛEnumTypes is a map, keyed by a YANG schema path, of the enumerated types that correspond with the leaf. The type is represented as a reflect.Type. The naming of the map ensures that there are no clashes with valid YANG identifiers.

Functions

func Schema

func Schema() (*ytypes.Schema, error)

Schema returns the details of the generated schema.

func Unmarshal

func Unmarshal(data []byte, destStruct ygot.GoStruct, opts ...ytypes.UnmarshalOpt) error

Unmarshal unmarshals data, which must be RFC7951 JSON format, into destStruct, which must be non-nil and the correct GoStruct type. It returns an error if the destStruct is not found in the schema or the data cannot be unmarshaled. The supplied options (opts) are used to control the behaviour of the unmarshal function - for example, determining whether errors are thrown for unknown fields in the input JSON.

func UnzipSchema

func UnzipSchema() (map[string]*yang.Entry, error)

UnzipSchema unzips the zipped schema and returns a map of yang.Entry nodes, keyed by the name of the struct that the yang.Entry describes the schema for.

Types

type Binary

type Binary []byte

Binary is a type that is used for fields that have a YANG type of binary. It is used such that binary fields can be distinguished from leaf-lists of uint8s (which are mapped to []uint8, equivalent to []byte in reflection).

type Device

type Device struct {
	Cont1A         *OnfTest1_Cont1A      `path:"cont1a" module:"onf-test1"`
	Cont1BState    *OnfTest1_Cont1BState `path:"cont1b-state" module:"onf-test1"`
	LeafAtTopLevel *string               `path:"leafAtTopLevel" module:"onf-test1"`
}

Device represents the /device YANG schema element.

func (*Device) IsYANGGoStruct

func (*Device) IsYANGGoStruct()

IsYANGGoStruct ensures that Device implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*Device) Validate

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

Validate validates s against the YANG schema corresponding to its type.

func (*Device) ΛEnumTypeMap

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type E_OnfTest1Identities_MYBASE added in v0.8.11

type E_OnfTest1Identities_MYBASE int64

E_OnfTest1Identities_MYBASE is a derived int64 type which is used to represent the enumerated node OnfTest1Identities_MYBASE. An additional value named OnfTest1Identities_MYBASE_UNSET is added to the enumeration which is used as the nil value, indicating that the enumeration was not explicitly set by the program importing the generated structures.

const (
	// OnfTest1Identities_MYBASE_UNSET corresponds to the value UNSET of OnfTest1Identities_MYBASE
	OnfTest1Identities_MYBASE_UNSET E_OnfTest1Identities_MYBASE = 0
	// OnfTest1Identities_MYBASE_IDTYPE1 corresponds to the value IDTYPE1 of OnfTest1Identities_MYBASE
	OnfTest1Identities_MYBASE_IDTYPE1 E_OnfTest1Identities_MYBASE = 1
	// OnfTest1Identities_MYBASE_IDTYPE2 corresponds to the value IDTYPE2 of OnfTest1Identities_MYBASE
	OnfTest1Identities_MYBASE_IDTYPE2 E_OnfTest1Identities_MYBASE = 2
)

func (E_OnfTest1Identities_MYBASE) IsYANGGoEnum added in v0.8.11

func (E_OnfTest1Identities_MYBASE) IsYANGGoEnum()

IsYANGGoEnum ensures that OnfTest1Identities_MYBASE implements the yang.GoEnum interface. This ensures that OnfTest1Identities_MYBASE can be identified as a mapped type for a YANG enumeration.

func (E_OnfTest1Identities_MYBASE) String added in v0.8.11

String returns a logging-friendly string for E_OnfTest1Identities_MYBASE.

func (E_OnfTest1Identities_MYBASE) ΛMap added in v0.8.11

ΛMap returns the value lookup map associated with OnfTest1Identities_MYBASE.

type E_OnfTest1_Cont1A_Cont2D_Chocolate added in v0.8.11

type E_OnfTest1_Cont1A_Cont2D_Chocolate int64

E_OnfTest1_Cont1A_Cont2D_Chocolate is a derived int64 type which is used to represent the enumerated node OnfTest1_Cont1A_Cont2D_Chocolate. An additional value named OnfTest1_Cont1A_Cont2D_Chocolate_UNSET is added to the enumeration which is used as the nil value, indicating that the enumeration was not explicitly set by the program importing the generated structures.

const (
	// OnfTest1_Cont1A_Cont2D_Chocolate_UNSET corresponds to the value UNSET of OnfTest1_Cont1A_Cont2D_Chocolate
	OnfTest1_Cont1A_Cont2D_Chocolate_UNSET E_OnfTest1_Cont1A_Cont2D_Chocolate = 0
	// OnfTest1_Cont1A_Cont2D_Chocolate_dark corresponds to the value dark of OnfTest1_Cont1A_Cont2D_Chocolate
	OnfTest1_Cont1A_Cont2D_Chocolate_dark E_OnfTest1_Cont1A_Cont2D_Chocolate = 1
	// OnfTest1_Cont1A_Cont2D_Chocolate_milk corresponds to the value milk of OnfTest1_Cont1A_Cont2D_Chocolate
	OnfTest1_Cont1A_Cont2D_Chocolate_milk E_OnfTest1_Cont1A_Cont2D_Chocolate = 2
	// OnfTest1_Cont1A_Cont2D_Chocolate_first_available corresponds to the value first_available of OnfTest1_Cont1A_Cont2D_Chocolate
	OnfTest1_Cont1A_Cont2D_Chocolate_first_available E_OnfTest1_Cont1A_Cont2D_Chocolate = 3
)

func (E_OnfTest1_Cont1A_Cont2D_Chocolate) IsYANGGoEnum added in v0.8.11

func (E_OnfTest1_Cont1A_Cont2D_Chocolate) IsYANGGoEnum()

IsYANGGoEnum ensures that OnfTest1_Cont1A_Cont2D_Chocolate implements the yang.GoEnum interface. This ensures that OnfTest1_Cont1A_Cont2D_Chocolate can be identified as a mapped type for a YANG enumeration.

func (E_OnfTest1_Cont1A_Cont2D_Chocolate) String added in v0.8.11

String returns a logging-friendly string for E_OnfTest1_Cont1A_Cont2D_Chocolate.

func (E_OnfTest1_Cont1A_Cont2D_Chocolate) ΛMap added in v0.8.11

ΛMap returns the value lookup map associated with OnfTest1_Cont1A_Cont2D_Chocolate.

type OnfTest1_Cont1A added in v0.8.11

type OnfTest1_Cont1A struct {
	Cont2A *OnfTest1_Cont1A_Cont2A            `path:"cont2a" module:"onf-test1"`
	Cont2D *OnfTest1_Cont1A_Cont2D            `path:"cont2d" module:"onf-test1-augmented"`
	Leaf1A *string                            `path:"leaf1a" module:"onf-test1"`
	List2A map[string]*OnfTest1_Cont1A_List2A `path:"list2a" module:"onf-test1"`
}

OnfTest1_Cont1A represents the /onf-test1/cont1a YANG schema element.

func (*OnfTest1_Cont1A) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1A) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1A implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1A) NewList2A added in v0.8.11

func (t *OnfTest1_Cont1A) NewList2A(Name string) (*OnfTest1_Cont1A_List2A, error)

NewList2A creates a new entry in the List2A list of the OnfTest1_Cont1A struct. The keys of the list are populated from the input arguments.

func (*OnfTest1_Cont1A) Validate added in v0.8.11

func (t *OnfTest1_Cont1A) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1A) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type OnfTest1_Cont1A_Cont2A added in v0.8.11

type OnfTest1_Cont1A_Cont2A struct {
	Leaf2A *uint8   `path:"leaf2a" module:"onf-test1"`
	Leaf2B *float64 `path:"leaf2b" module:"onf-test1"`
	Leaf2C *string  `path:"leaf2c" module:"onf-test1"`
	Leaf2D *float64 `path:"leaf2d" module:"onf-test1"`
	Leaf2E []int16  `path:"leaf2e" module:"onf-test1"`
	Leaf2F Binary   `path:"leaf2f" module:"onf-test1"`
	Leaf2G *bool    `path:"leaf2g" module:"onf-test1"`
}

OnfTest1_Cont1A_Cont2A represents the /onf-test1/cont1a/cont2a YANG schema element.

func (*OnfTest1_Cont1A_Cont2A) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1A_Cont2A) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1A_Cont2A implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1A_Cont2A) Validate added in v0.8.11

func (t *OnfTest1_Cont1A_Cont2A) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1A_Cont2A) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type OnfTest1_Cont1A_Cont2D added in v0.8.11

type OnfTest1_Cont1A_Cont2D struct {
	Beer      YANGEmpty                          `path:"beer" module:"onf-test1-augmented"`
	Chocolate E_OnfTest1_Cont1A_Cont2D_Chocolate `path:"chocolate" module:"onf-test1-augmented"`
	Leaf2D3C  *string                            `path:"leaf2d3c" module:"onf-test1-augmented"`
	Pretzel   YANGEmpty                          `path:"pretzel" module:"onf-test1-augmented"`
}

OnfTest1_Cont1A_Cont2D represents the /onf-test1/cont1a/cont2d YANG schema element.

func (*OnfTest1_Cont1A_Cont2D) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1A_Cont2D) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1A_Cont2D implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1A_Cont2D) Validate added in v0.8.11

func (t *OnfTest1_Cont1A_Cont2D) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1A_Cont2D) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type OnfTest1_Cont1A_List2A added in v0.8.11

type OnfTest1_Cont1A_List2A struct {
	Name    *string `path:"name" module:"onf-test1"`
	RxPower *uint16 `path:"rx-power" module:"onf-test1"`
	TxPower *uint16 `path:"tx-power" module:"onf-test1"`
}

OnfTest1_Cont1A_List2A represents the /onf-test1/cont1a/list2a YANG schema element.

func (*OnfTest1_Cont1A_List2A) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1A_List2A) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1A_List2A implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1A_List2A) Validate added in v0.8.11

func (t *OnfTest1_Cont1A_List2A) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1A_List2A) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

func (*OnfTest1_Cont1A_List2A) ΛListKeyMap added in v0.8.11

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

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

type OnfTest1_Cont1BState added in v0.8.11

type OnfTest1_Cont1BState struct {
	Cont2C *OnfTest1_Cont1BState_Cont2C                                     `path:"cont2c" module:"onf-test1"`
	Leaf2D *uint16                                                          `path:"leaf2d" module:"onf-test1"`
	List2B map[OnfTest1_Cont1BState_List2B_Key]*OnfTest1_Cont1BState_List2B `path:"list2b" module:"onf-test1"`
}

OnfTest1_Cont1BState represents the /onf-test1/cont1b-state YANG schema element.

func (*OnfTest1_Cont1BState) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1BState) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1BState implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1BState) NewList2B added in v0.8.11

func (t *OnfTest1_Cont1BState) NewList2B(Index1 uint8, Index2 uint8) (*OnfTest1_Cont1BState_List2B, error)

NewList2B creates a new entry in the List2B list of the OnfTest1_Cont1BState struct. The keys of the list are populated from the input arguments.

func (*OnfTest1_Cont1BState) Validate added in v0.8.11

func (t *OnfTest1_Cont1BState) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1BState) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type OnfTest1_Cont1BState_Cont2C added in v0.8.11

type OnfTest1_Cont1BState_Cont2C struct {
	Leaf3A *bool   `path:"leaf3a" module:"onf-test1"`
	Leaf3B *string `path:"leaf3b" module:"onf-test1"`
}

OnfTest1_Cont1BState_Cont2C represents the /onf-test1/cont1b-state/cont2c YANG schema element.

func (*OnfTest1_Cont1BState_Cont2C) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1BState_Cont2C) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1BState_Cont2C implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1BState_Cont2C) Validate added in v0.8.11

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1BState_Cont2C) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type OnfTest1_Cont1BState_List2B added in v0.8.11

type OnfTest1_Cont1BState_List2B struct {
	Index1 *uint8                      `path:"index1" module:"onf-test1"`
	Index2 *uint8                      `path:"index2" module:"onf-test1"`
	Leaf3C *string                     `path:"leaf3c" module:"onf-test1"`
	Leaf3D E_OnfTest1Identities_MYBASE `path:"leaf3d" module:"onf-test1"`
}

OnfTest1_Cont1BState_List2B represents the /onf-test1/cont1b-state/list2b YANG schema element.

func (*OnfTest1_Cont1BState_List2B) IsYANGGoStruct added in v0.8.11

func (*OnfTest1_Cont1BState_List2B) IsYANGGoStruct()

IsYANGGoStruct ensures that OnfTest1_Cont1BState_List2B implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*OnfTest1_Cont1BState_List2B) Validate added in v0.8.11

Validate validates s against the YANG schema corresponding to its type.

func (*OnfTest1_Cont1BState_List2B) ΛEnumTypeMap added in v0.8.11

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

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

func (*OnfTest1_Cont1BState_List2B) ΛListKeyMap added in v0.8.11

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

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

type OnfTest1_Cont1BState_List2B_Key added in v0.8.11

type OnfTest1_Cont1BState_List2B_Key struct {
	Index1 uint8 `path:"index1"`
	Index2 uint8 `path:"index2"`
}

OnfTest1_Cont1BState_List2B_Key represents the key for list List2B of element /onf-test1/cont1b-state.

type YANGEmpty

type YANGEmpty bool

YANGEmpty is a type that is used for fields that have a YANG type of empty. It is used such that empty fields can be distinguished from boolean fields in the generated code.

Jump to

Keyboard shortcuts

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