ctestschema

package
v0.29.20 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ctestschema 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 true in this case).

This package was generated by /usr/local/google/home/wenbli/gocode/src/github.com/openconfig/ygot/genutil/names.go using the following YANG input files:

  • ../yang/ctestschema.yang
  • ../yang/ctestschema-rootmod.yang

Imported modules were sourced from:

  • ...

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemaTree map[string]*yang.Entry
	ΛEnumTypes map[string][]reflect.Type
)

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 {
	ΛMetadata              []ygot.Annotation                 `path:"@" ygotAnnotation:"true"`
	OrderedList            *OrderedList_OrderedMap           `path:"ordered-lists/ordered-list" module:"ctestschema/ctestschema"`
	ΛOrderedList           []ygot.Annotation                 `path:"ordered-lists/@ordered-list" ygotAnnotation:"true"`
	OrderedMultikeyedList  *OrderedMultikeyedList_OrderedMap `path:"ordered-multikeyed-lists/ordered-multikeyed-list" module:"ctestschema-rootmod/ctestschema"`
	ΛOrderedMultikeyedList []ygot.Annotation                 `path:"ordered-multikeyed-lists/@ordered-multikeyed-list" ygotAnnotation:"true"`
	OtherData              *OtherData                        `path:"other-data" module:"ctestschema"`
	ΛOtherData             []ygot.Annotation                 `path:"@other-data" ygotAnnotation:"true"`
	UnorderedList          map[string]*UnorderedList         `path:"unordered-lists/unordered-list" module:"ctestschema/ctestschema"`
	ΛUnorderedList         []ygot.Annotation                 `path:"unordered-lists/@unordered-list" ygotAnnotation:"true"`
}

Device represents the /device YANG schema element.

func (*Device) AppendNewOrderedList

func (s *Device) AppendNewOrderedList(Key string) (*OrderedList, error)

AppendNewOrderedList creates a new entry in the OrderedList ordered map of the Device struct. The keys of the list are populated from the input arguments.

func (*Device) AppendNewOrderedMultikeyedList

func (s *Device) AppendNewOrderedMultikeyedList(Key1 string, Key2 uint64) (*OrderedMultikeyedList, error)

AppendNewOrderedMultikeyedList creates a new entry in the OrderedMultikeyedList ordered map of the Device struct. The keys of the list are populated from the input arguments.

func (*Device) AppendOrderedList

func (s *Device) AppendOrderedList(v *OrderedList) error

AppendOrderedList appends the supplied OrderedList struct to the list OrderedList of Device. If the key value(s) specified in the supplied OrderedList already exist in the list, an error is returned.

func (*Device) AppendOrderedMultikeyedList

func (s *Device) AppendOrderedMultikeyedList(v *OrderedMultikeyedList) error

AppendOrderedMultikeyedList appends the supplied OrderedMultikeyedList struct to the list OrderedMultikeyedList of Device. If the key value(s) specified in the supplied OrderedMultikeyedList already exist in the list, an error is returned.

func (*Device) AppendUnorderedList

func (t *Device) AppendUnorderedList(v *UnorderedList) error

AppendUnorderedList appends the supplied UnorderedList struct to the list UnorderedList of Device. If the key value(s) specified in the supplied UnorderedList already exist in the list, an error is returned.

func (*Device) DeleteOrderedList

func (s *Device) DeleteOrderedList(Key string) bool

DeleteOrderedList deletes the value with the specified keys from the receiver Device. If there is no such element, the function is a no-op.

func (*Device) DeleteOrderedMultikeyedList

func (s *Device) DeleteOrderedMultikeyedList(Key1 string, Key2 uint64) bool

DeleteOrderedMultikeyedList deletes the value with the specified keys from the receiver Device. If there is no such element, the function is a no-op.

func (*Device) GetOrCreateOrderedListMap added in v0.29.19

func (s *Device) GetOrCreateOrderedListMap() *OrderedList_OrderedMap

GetOrCreateOrderedListMap returns the ordered map field OrderedList from Device.

It initializes the field if not already initialized.

func (*Device) GetOrCreateOrderedMultikeyedListMap added in v0.29.19

func (s *Device) GetOrCreateOrderedMultikeyedListMap() *OrderedMultikeyedList_OrderedMap

GetOrCreateOrderedMultikeyedListMap returns the ordered map field OrderedMultikeyedList from Device.

It initializes the field if not already initialized.

func (*Device) GetOrCreateOtherData added in v0.29.0

func (t *Device) GetOrCreateOtherData() *OtherData

GetOrCreateOtherData retrieves the value of the OtherData field or returns the existing field if it already exists.

func (*Device) GetOrCreateUnorderedList

func (t *Device) GetOrCreateUnorderedList(Key string) *UnorderedList

GetOrCreateUnorderedList retrieves the value with the specified keys from the receiver Device. If the entry does not exist, then it is created. It returns the existing or new list member.

func (*Device) GetOrCreateUnorderedListMap added in v0.29.19

func (t *Device) GetOrCreateUnorderedListMap() map[string]*UnorderedList

GetOrCreateUnorderedListMap returns the list (map) from Device.

It initializes the field if not already initialized.

func (*Device) GetOrderedList

func (s *Device) GetOrderedList(Key string) *OrderedList

GetOrderedList retrieves the value with the specified key from the OrderedList map field of Device. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

func (*Device) GetOrderedMultikeyedList

func (s *Device) GetOrderedMultikeyedList(Key1 string, Key2 uint64) *OrderedMultikeyedList

GetOrderedMultikeyedList retrieves the value with the specified key from the OrderedMultikeyedList map field of Device. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

func (*Device) GetOtherData added in v0.29.0

func (t *Device) GetOtherData() *OtherData

GetOtherData returns the value of the OtherData struct pointer from Device. If the receiver or the field OtherData is nil, nil is returned such that the Get* methods can be safely chained.

func (*Device) GetUnorderedList

func (t *Device) GetUnorderedList(Key string) *UnorderedList

GetUnorderedList retrieves the value with the specified key from the UnorderedList map field of Device. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

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) NewUnorderedList

func (t *Device) NewUnorderedList(Key string) (*UnorderedList, error)

NewUnorderedList creates a new entry in the UnorderedList list of the Device struct. The keys of the list are populated from the input arguments.

func (*Device) PopulateDefaults added in v0.29.0

func (t *Device) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the Device with default values as specified in the YANG schema, instantiating any nil container fields.

func (*Device) RenameUnorderedList

func (t *Device) RenameUnorderedList(oldK, newK string) error

RenameUnorderedList renames an entry in the list UnorderedList within the Device struct. The entry with key oldK is renamed to newK updating the key within the value.

func (*Device) Validate

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

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

func (*Device) ΛBelongingModule

func (*Device) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of Device.

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.

func (*Device) ΛValidate

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

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

type MapStructTestOne added in v0.29.0

type MapStructTestOne struct {
	Child       *MapStructTestOneChild  `path:"child" module:"test-one"`
	OrderedList *OrderedList_OrderedMap `path:"ordered-lists/ordered-list" module:"ctestschema/ctestschema"`
}

MapStructTestOne is the base struct used for the simple-schema test.

func (*MapStructTestOne) IsYANGGoStruct added in v0.29.0

func (*MapStructTestOne) IsYANGGoStruct()

IsYANGGoStruct makes sure that we implement the GoStruct interface.

func (*MapStructTestOne) ΛBelongingModule added in v0.29.0

func (*MapStructTestOne) ΛBelongingModule() string

func (*MapStructTestOne) ΛEnumTypeMap added in v0.29.0

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

func (*MapStructTestOne) ΛValidate added in v0.29.0

func (*MapStructTestOne) ΛValidate(...ygot.ValidationOption) error

type MapStructTestOneChild added in v0.29.0

type MapStructTestOneChild struct {
	FieldOne    *string                 `path:"config/field-one" module:"test-one/test-one"`
	FieldTwo    *uint32                 `path:"config/field-two" module:"test-one/test-one"`
	FieldThree  Binary                  `path:"config/field-three" module:"test-one/test-one"`
	FieldFour   []Binary                `path:"config/field-four" module:"test-one/test-one"`
	FieldFive   *uint64                 `path:"config/field-five" module:"test-five/test-five"`
	OrderedList *OrderedList_OrderedMap `path:"ordered-lists/ordered-list" module:"ctestschema/ctestschema"`
}

MapStructTestOneChild is a child structure of the MapStructTestOne test case.

func (*MapStructTestOneChild) IsYANGGoStruct added in v0.29.0

func (*MapStructTestOneChild) IsYANGGoStruct()

IsYANGGoStruct makes sure that we implement the GoStruct interface.

func (*MapStructTestOneChild) ΛBelongingModule added in v0.29.0

func (*MapStructTestOneChild) ΛBelongingModule() string

func (*MapStructTestOneChild) ΛEnumTypeMap added in v0.29.0

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

func (*MapStructTestOneChild) ΛValidate added in v0.29.0

type OrderedList

type OrderedList struct {
	ΛMetadata    []ygot.Annotation                   `path:"@" ygotAnnotation:"true"`
	Key          *string                             `` /* 146-byte string literal not displayed */
	ΛKey         []ygot.Annotation                   `path:"config/@key|@key" ygotAnnotation:"true"`
	OrderedList  *OrderedList_OrderedList_OrderedMap `path:"ordered-lists/ordered-list" module:"ctestschema/ctestschema"`
	ΛOrderedList []ygot.Annotation                   `path:"ordered-lists/@ordered-list" ygotAnnotation:"true"`
	ParentKey    *string                             `path:"state/parent-key" module:"ctestschema/ctestschema"`
	ΛParentKey   []ygot.Annotation                   `path:"state/@parent-key" ygotAnnotation:"true"`
	RoValue      *string                             `path:"state/ro-value" module:"ctestschema/ctestschema"`
	ΛRoValue     []ygot.Annotation                   `path:"state/@ro-value" ygotAnnotation:"true"`
	Value        *string                             `path:"config/value" module:"ctestschema/ctestschema" shadow-path:"state/value" shadow-module:"ctestschema/ctestschema"`
	ΛValue       []ygot.Annotation                   `path:"config/@value" ygotAnnotation:"true"`
}

OrderedList represents the /ctestschema/ordered-lists/ordered-list YANG schema element.

func (*OrderedList) AppendNewOrderedList added in v0.29.0

func (s *OrderedList) AppendNewOrderedList(Key string) (*OrderedList_OrderedList, error)

AppendNewOrderedList creates a new entry in the OrderedList ordered map of the OrderedList struct. The keys of the list are populated from the input arguments.

func (*OrderedList) AppendOrderedList added in v0.29.0

func (s *OrderedList) AppendOrderedList(v *OrderedList_OrderedList) error

AppendOrderedList appends the supplied OrderedList_OrderedList struct to the list OrderedList of OrderedList. If the key value(s) specified in the supplied OrderedList_OrderedList already exist in the list, an error is returned.

func (*OrderedList) DeleteOrderedList added in v0.29.0

func (s *OrderedList) DeleteOrderedList(Key string) bool

DeleteOrderedList deletes the value with the specified keys from the receiver OrderedList. If there is no such element, the function is a no-op.

func (*OrderedList) GetKey

func (t *OrderedList) GetKey() string

GetKey retrieves the value of the leaf Key from the OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Key is set, it can safely use t.GetKey() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Key == nil' before retrieving the leaf's value.

func (*OrderedList) GetOrCreateOrderedListMap added in v0.29.19

func (s *OrderedList) GetOrCreateOrderedListMap() *OrderedList_OrderedList_OrderedMap

GetOrCreateOrderedListMap returns the ordered map field OrderedList from OrderedList.

It initializes the field if not already initialized.

func (*OrderedList) GetOrderedList added in v0.29.0

func (s *OrderedList) GetOrderedList(Key string) *OrderedList_OrderedList

GetOrderedList retrieves the value with the specified key from the OrderedList map field of OrderedList. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

func (*OrderedList) GetParentKey added in v0.29.0

func (t *OrderedList) GetParentKey() string

GetParentKey retrieves the value of the leaf ParentKey from the OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if ParentKey is set, it can safely use t.GetParentKey() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.ParentKey == nil' before retrieving the leaf's value.

func (*OrderedList) GetRoValue added in v0.29.0

func (t *OrderedList) GetRoValue() string

GetRoValue retrieves the value of the leaf RoValue from the OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if RoValue is set, it can safely use t.GetRoValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.RoValue == nil' before retrieving the leaf's value.

func (*OrderedList) GetValue

func (t *OrderedList) GetValue() string

GetValue retrieves the value of the leaf Value from the OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Value is set, it can safely use t.GetValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Value == nil' before retrieving the leaf's value.

func (*OrderedList) IsYANGGoStruct

func (*OrderedList) IsYANGGoStruct()

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

func (*OrderedList) PopulateDefaults added in v0.29.0

func (t *OrderedList) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the OrderedList with default values as specified in the YANG schema, instantiating any nil container fields.

func (*OrderedList) Validate

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

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

func (*OrderedList) ΛBelongingModule

func (*OrderedList) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of OrderedList.

func (*OrderedList) ΛEnumTypeMap

func (t *OrderedList) Λ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 (*OrderedList) ΛListKeyMap

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

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

func (*OrderedList) ΛValidate

func (t *OrderedList) ΛValidate(opts ...ygot.ValidationOption) error

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

type OrderedList_OrderedList added in v0.29.0

type OrderedList_OrderedList struct {
	ΛMetadata  []ygot.Annotation `path:"@" ygotAnnotation:"true"`
	Key        *string           `` /* 146-byte string literal not displayed */
	ΛKey       []ygot.Annotation `path:"config/@key|@key" ygotAnnotation:"true"`
	ParentKey  *string           `path:"state/parent-key" module:"ctestschema/ctestschema"`
	ΛParentKey []ygot.Annotation `path:"state/@parent-key" ygotAnnotation:"true"`
	Value      *string           `path:"config/value" module:"ctestschema/ctestschema" shadow-path:"state/value" shadow-module:"ctestschema/ctestschema"`
	ΛValue     []ygot.Annotation `path:"config/@value" ygotAnnotation:"true"`
}

OrderedList_OrderedList represents the /ctestschema/ordered-lists/ordered-list/ordered-lists/ordered-list YANG schema element.

func (*OrderedList_OrderedList) GetKey added in v0.29.0

func (t *OrderedList_OrderedList) GetKey() string

GetKey retrieves the value of the leaf Key from the OrderedList_OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Key is set, it can safely use t.GetKey() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Key == nil' before retrieving the leaf's value.

func (*OrderedList_OrderedList) GetParentKey added in v0.29.0

func (t *OrderedList_OrderedList) GetParentKey() string

GetParentKey retrieves the value of the leaf ParentKey from the OrderedList_OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if ParentKey is set, it can safely use t.GetParentKey() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.ParentKey == nil' before retrieving the leaf's value.

func (*OrderedList_OrderedList) GetValue added in v0.29.0

func (t *OrderedList_OrderedList) GetValue() string

GetValue retrieves the value of the leaf Value from the OrderedList_OrderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Value is set, it can safely use t.GetValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Value == nil' before retrieving the leaf's value.

func (*OrderedList_OrderedList) IsYANGGoStruct added in v0.29.0

func (*OrderedList_OrderedList) IsYANGGoStruct()

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

func (*OrderedList_OrderedList) PopulateDefaults added in v0.29.0

func (t *OrderedList_OrderedList) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the OrderedList_OrderedList with default values as specified in the YANG schema, instantiating any nil container fields.

func (*OrderedList_OrderedList) Validate added in v0.29.0

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

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

func (*OrderedList_OrderedList) ΛBelongingModule added in v0.29.0

func (*OrderedList_OrderedList) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of OrderedList_OrderedList.

func (*OrderedList_OrderedList) ΛEnumTypeMap added in v0.29.0

func (t *OrderedList_OrderedList) Λ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 (*OrderedList_OrderedList) ΛListKeyMap added in v0.29.0

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

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

func (*OrderedList_OrderedList) ΛValidate added in v0.29.0

func (t *OrderedList_OrderedList) ΛValidate(opts ...ygot.ValidationOption) error

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

type OrderedList_OrderedList_OrderedMap added in v0.29.0

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

OrderedList_OrderedList_OrderedMap is an ordered map that represents the "ordered-by user" list elements at /ctestschema/ordered-lists/ordered-list/ordered-lists/ordered-list.

func (*OrderedList_OrderedList_OrderedMap) Append added in v0.29.0

Append appends a OrderedList_OrderedList, returning an error if the key already exists in the ordered list or if the key is unspecified.

func (*OrderedList_OrderedList_OrderedMap) AppendNew added in v0.29.0

AppendNew creates and appends a new OrderedList_OrderedList, returning the newly-initialized v. It returns an error if the v already exists.

func (*OrderedList_OrderedList_OrderedMap) Delete added in v0.29.0

Delete deletes an element.

func (*OrderedList_OrderedList_OrderedMap) Get added in v0.29.0

Get returns the value corresponding to the key. If the key is not found, nil is returned.

func (*OrderedList_OrderedList_OrderedMap) IsYANGOrderedList added in v0.29.0

func (*OrderedList_OrderedList_OrderedMap) IsYANGOrderedList()

IsYANGOrderedList ensures that OrderedList_OrderedList_OrderedMap implements the ygot.GoOrderedMap interface.

func (*OrderedList_OrderedList_OrderedMap) Keys added in v0.29.0

Keys returns a copy of the list's keys.

func (*OrderedList_OrderedList_OrderedMap) Len added in v0.29.0

Len returns a size of OrderedList_OrderedList_OrderedMap

func (*OrderedList_OrderedList_OrderedMap) Values added in v0.29.0

Values returns the current set of the list's values in order.

type OrderedList_OrderedMap

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

OrderedList_OrderedMap is an ordered map that represents the "ordered-by user" list elements at /ctestschema/ordered-lists/ordered-list.

func GetNestedOrderedMap added in v0.29.0

func GetNestedOrderedMap(t *testing.T) *OrderedList_OrderedMap

GetNestedOrderedMap returns a populated nested ordered map with dummy values.

- foo: foo-val

  • foo: foo-val
  • bar: bar-val

func GetOrderedMap added in v0.29.0

func GetOrderedMap(t *testing.T) *OrderedList_OrderedMap

GetOrderedMap returns a populated ordered map with dummy values.

- foo: foo-val - bar: bar-val

func GetOrderedMap2 added in v0.29.0

func GetOrderedMap2(t *testing.T) *OrderedList_OrderedMap

GetOrderedMap2 returns a populated ordered map with different dummy values.

- wee: wee-val - woo: woo-val

func GetOrderedMapLonger added in v0.29.0

func GetOrderedMapLonger(t *testing.T) *OrderedList_OrderedMap

GetOrderedMapLonger returns a populated ordered map with more dummy values.

- foo: foo-val - bar: bar-val - baz: baz-val

func (*OrderedList_OrderedMap) Append

Append appends a OrderedList, returning an error if the key already exists in the ordered list or if the key is unspecified.

func (*OrderedList_OrderedMap) AppendNew

func (o *OrderedList_OrderedMap) AppendNew(Key string) (*OrderedList, error)

AppendNew creates and appends a new OrderedList, returning the newly-initialized v. It returns an error if the v already exists.

func (*OrderedList_OrderedMap) Delete

func (o *OrderedList_OrderedMap) Delete(key string) bool

Delete deletes an element.

func (*OrderedList_OrderedMap) Get

Get returns the value corresponding to the key. If the key is not found, nil is returned.

func (*OrderedList_OrderedMap) IsYANGOrderedList

func (*OrderedList_OrderedMap) IsYANGOrderedList()

IsYANGOrderedList ensures that OrderedList_OrderedMap implements the ygot.GoOrderedMap interface.

func (*OrderedList_OrderedMap) Keys

func (o *OrderedList_OrderedMap) Keys() []string

Keys returns a copy of the list's keys.

func (*OrderedList_OrderedMap) Len

func (o *OrderedList_OrderedMap) Len() int

Len returns a size of OrderedList_OrderedMap

func (*OrderedList_OrderedMap) Values

func (o *OrderedList_OrderedMap) Values() []*OrderedList

Values returns the current set of the list's values in order.

type OrderedMultikeyedList

type OrderedMultikeyedList struct {
	ΛMetadata []ygot.Annotation `path:"@" ygotAnnotation:"true"`
	Key1      *string           `` /* 150-byte string literal not displayed */
	ΛKey1     []ygot.Annotation `path:"config/@key1|@key1" ygotAnnotation:"true"`
	Key2      *uint64           `` /* 150-byte string literal not displayed */
	ΛKey2     []ygot.Annotation `path:"config/@key2|@key2" ygotAnnotation:"true"`
	RoValue   *string           `path:"state/ro-value" module:"ctestschema/ctestschema"`
	ΛRoValue  []ygot.Annotation `path:"state/@ro-value" ygotAnnotation:"true"`
	Value     *string           `path:"config/value" module:"ctestschema/ctestschema" shadow-path:"state/value" shadow-module:"ctestschema/ctestschema"`
	ΛValue    []ygot.Annotation `path:"config/@value" ygotAnnotation:"true"`
}

OrderedMultikeyedList represents the /ctestschema-rootmod/ordered-multikeyed-lists/ordered-multikeyed-list YANG schema element.

func (*OrderedMultikeyedList) GetKey1

func (t *OrderedMultikeyedList) GetKey1() string

GetKey1 retrieves the value of the leaf Key1 from the OrderedMultikeyedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Key1 is set, it can safely use t.GetKey1() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Key1 == nil' before retrieving the leaf's value.

func (*OrderedMultikeyedList) GetKey2

func (t *OrderedMultikeyedList) GetKey2() uint64

GetKey2 retrieves the value of the leaf Key2 from the OrderedMultikeyedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Key2 is set, it can safely use t.GetKey2() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Key2 == nil' before retrieving the leaf's value.

func (*OrderedMultikeyedList) GetRoValue added in v0.29.0

func (t *OrderedMultikeyedList) GetRoValue() string

GetRoValue retrieves the value of the leaf RoValue from the OrderedMultikeyedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if RoValue is set, it can safely use t.GetRoValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.RoValue == nil' before retrieving the leaf's value.

func (*OrderedMultikeyedList) GetValue

func (t *OrderedMultikeyedList) GetValue() string

GetValue retrieves the value of the leaf Value from the OrderedMultikeyedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Value is set, it can safely use t.GetValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Value == nil' before retrieving the leaf's value.

func (*OrderedMultikeyedList) IsYANGGoStruct

func (*OrderedMultikeyedList) IsYANGGoStruct()

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

func (*OrderedMultikeyedList) PopulateDefaults added in v0.29.0

func (t *OrderedMultikeyedList) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the OrderedMultikeyedList with default values as specified in the YANG schema, instantiating any nil container fields.

func (*OrderedMultikeyedList) Validate

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

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

func (*OrderedMultikeyedList) ΛBelongingModule

func (*OrderedMultikeyedList) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of OrderedMultikeyedList.

func (*OrderedMultikeyedList) ΛEnumTypeMap

func (t *OrderedMultikeyedList) Λ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 (*OrderedMultikeyedList) ΛListKeyMap

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

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

func (*OrderedMultikeyedList) ΛValidate

func (t *OrderedMultikeyedList) ΛValidate(opts ...ygot.ValidationOption) error

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

type OrderedMultikeyedList_Key

type OrderedMultikeyedList_Key struct {
	Key1 string `path:"key1"`
	Key2 uint64 `path:"key2"`
}

OrderedMultikeyedList_Key represents the key for list OrderedMultikeyedList of element /device.

func (OrderedMultikeyedList_Key) IsYANGGoKeyStruct

func (OrderedMultikeyedList_Key) IsYANGGoKeyStruct()

IsYANGGoKeyStruct ensures that OrderedMultikeyedList_Key partially implements the yang.GoKeyStruct interface. This allows functions that need to handle this key struct to identify it as being generated by gogen.

func (OrderedMultikeyedList_Key) ΛListKeyMap

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

ΛListKeyMap returns the values of the OrderedMultikeyedList_Key key struct.

type OrderedMultikeyedList_OrderedMap

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

OrderedMultikeyedList_OrderedMap is an ordered map that represents the "ordered-by user" list elements at /ctestschema-rootmod/ordered-multikeyed-lists/ordered-multikeyed-list.

func GetOrderedMapMultikeyed added in v0.29.0

func GetOrderedMapMultikeyed(t *testing.T) *OrderedMultikeyedList_OrderedMap

GetOrderedMapMultikeyed returns a populated multi-keyed ordered map with dummy values.

- foo, 42: foo-val - bar, 42: bar-val - baz, 84: baz-val

func (*OrderedMultikeyedList_OrderedMap) Append

Append appends a OrderedMultikeyedList, returning an error if the key already exists in the ordered list or if the key is unspecified.

func (*OrderedMultikeyedList_OrderedMap) AppendNew

AppendNew creates and appends a new OrderedMultikeyedList, returning the newly-initialized v. It returns an error if the v already exists.

func (*OrderedMultikeyedList_OrderedMap) Delete

Delete deletes an element.

func (*OrderedMultikeyedList_OrderedMap) Get

Get returns the value corresponding to the key. If the key is not found, nil is returned.

func (*OrderedMultikeyedList_OrderedMap) IsYANGOrderedList

func (*OrderedMultikeyedList_OrderedMap) IsYANGOrderedList()

IsYANGOrderedList ensures that OrderedMultikeyedList_OrderedMap implements the ygot.GoOrderedMap interface.

func (*OrderedMultikeyedList_OrderedMap) Keys

Keys returns a copy of the list's keys.

func (*OrderedMultikeyedList_OrderedMap) Len

Len returns a size of OrderedMultikeyedList_OrderedMap

func (*OrderedMultikeyedList_OrderedMap) Values

Values returns the current set of the list's values in order.

type OtherData added in v0.29.0

type OtherData struct {
	ΛMetadata []ygot.Annotation `path:"@" ygotAnnotation:"true"`
	Motd      *string           `path:"config/motd" module:"ctestschema/ctestschema" shadow-path:"state/motd" shadow-module:"ctestschema/ctestschema"`
	ΛMotd     []ygot.Annotation `path:"config/@motd" ygotAnnotation:"true"`
}

OtherData represents the /ctestschema/other-data YANG schema element.

func (*OtherData) GetMotd added in v0.29.0

func (t *OtherData) GetMotd() string

GetMotd retrieves the value of the leaf Motd from the OtherData struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Motd is set, it can safely use t.GetMotd() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Motd == nil' before retrieving the leaf's value.

func (*OtherData) IsYANGGoStruct added in v0.29.0

func (*OtherData) IsYANGGoStruct()

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

func (*OtherData) PopulateDefaults added in v0.29.0

func (t *OtherData) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the OtherData with default values as specified in the YANG schema, instantiating any nil container fields.

func (*OtherData) Validate added in v0.29.0

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

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

func (*OtherData) ΛBelongingModule added in v0.29.0

func (*OtherData) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of OtherData.

func (*OtherData) ΛEnumTypeMap added in v0.29.0

func (t *OtherData) Λ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 (*OtherData) ΛValidate added in v0.29.0

func (t *OtherData) ΛValidate(opts ...ygot.ValidationOption) error

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

type UnionBool

type UnionBool bool

UnionBool is a bool type assignable to unions of which it is a subtype.

type UnionFloat64

type UnionFloat64 float64

UnionFloat64 is a float64 type assignable to unions of which it is a subtype.

type UnionInt16

type UnionInt16 int16

UnionInt16 is an int16 type assignable to unions of which it is a subtype.

type UnionInt32

type UnionInt32 int32

UnionInt32 is an int32 type assignable to unions of which it is a subtype.

type UnionInt64

type UnionInt64 int64

UnionInt64 is an int64 type assignable to unions of which it is a subtype.

type UnionInt8

type UnionInt8 int8

UnionInt8 is an int8 type assignable to unions of which it is a subtype.

type UnionString

type UnionString string

UnionString is a string type assignable to unions of which it is a subtype.

type UnionUint16

type UnionUint16 uint16

UnionUint16 is a uint16 type assignable to unions of which it is a subtype.

type UnionUint32

type UnionUint32 uint32

UnionUint32 is a uint32 type assignable to unions of which it is a subtype.

type UnionUint64

type UnionUint64 uint64

UnionUint64 is a uint64 type assignable to unions of which it is a subtype.

type UnionUint8

type UnionUint8 uint8

UnionUint8 is a uint8 type assignable to unions of which it is a subtype.

type UnionUnsupported

type UnionUnsupported struct {
	Value interface{}
}

UnionUnsupported is an interface{} wrapper type for unsupported types. It is assignable to unions of which it is a subtype.

type UnorderedList

type UnorderedList struct {
	ΛMetadata []ygot.Annotation `path:"@" ygotAnnotation:"true"`
	Key       *string           `` /* 146-byte string literal not displayed */
	ΛKey      []ygot.Annotation `path:"config/@key|@key" ygotAnnotation:"true"`
	Value     *string           `path:"config/value" module:"ctestschema/ctestschema" shadow-path:"state/value" shadow-module:"ctestschema/ctestschema"`
	ΛValue    []ygot.Annotation `path:"config/@value" ygotAnnotation:"true"`
}

UnorderedList represents the /ctestschema/unordered-lists/unordered-list YANG schema element.

func (*UnorderedList) GetKey

func (t *UnorderedList) GetKey() string

GetKey retrieves the value of the leaf Key from the UnorderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Key is set, it can safely use t.GetKey() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Key == nil' before retrieving the leaf's value.

func (*UnorderedList) GetValue

func (t *UnorderedList) GetValue() string

GetValue retrieves the value of the leaf Value from the UnorderedList struct. If the field is unset but has a default value in the YANG schema, then the default value will be returned. Caution should be exercised whilst using this method since when without a default value, it will return the Go zero value if the field is explicitly unset. If the caller explicitly does not care if Value is set, it can safely use t.GetValue() to retrieve the value. In the case that the caller has different actions based on whether the leaf is set or unset, it should use 'if t.Value == nil' before retrieving the leaf's value.

func (*UnorderedList) IsYANGGoStruct

func (*UnorderedList) IsYANGGoStruct()

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

func (*UnorderedList) PopulateDefaults added in v0.29.0

func (t *UnorderedList) PopulateDefaults()

PopulateDefaults recursively populates unset leaf fields in the UnorderedList with default values as specified in the YANG schema, instantiating any nil container fields.

func (*UnorderedList) Validate

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

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

func (*UnorderedList) ΛBelongingModule

func (*UnorderedList) ΛBelongingModule() string

ΛBelongingModule returns the name of the module that defines the namespace of UnorderedList.

func (*UnorderedList) ΛEnumTypeMap

func (t *UnorderedList) Λ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 (*UnorderedList) ΛListKeyMap

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

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

func (*UnorderedList) ΛValidate

func (t *UnorderedList) ΛValidate(opts ...ygot.ValidationOption) error

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

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