Skip to content

Commit

Permalink
Make GoEnum a stringer (#374)
Browse files Browse the repository at this point in the history
* Make GoEnum a stringer

* Rename EnumString to EnumLogString and add tests
  • Loading branch information
wenovus authored Apr 14, 2020
1 parent 57f70c1 commit 9150fb3
Show file tree
Hide file tree
Showing 26 changed files with 39,758 additions and 38,011 deletions.
69,910 changes: 35,546 additions & 34,364 deletions exampleoc/oc.go

Large diffs are not rendered by default.

7,536 changes: 3,893 additions & 3,643 deletions uexampleoc/oc.go

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions ygen/gogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,11 @@ func (E_{{ .EnumerationPrefix }}) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with {{ .EnumerationPrefix }}.
func (E_{{ .EnumerationPrefix }}) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }
// String returns a logging-friendly string for E_{{ .EnumerationPrefix }}.
func (e E_{{ .EnumerationPrefix }}) String() string {
return ygot.EnumLogString(e, int64(e), "E_{{ .EnumerationPrefix }}")
}
{{ $enumName := .EnumerationPrefix -}}
const (
{{- range $i, $val := .Values }}
Expand Down Expand Up @@ -581,8 +586,7 @@ func (t *{{ .Receiver }}) New{{ .ListName }}(
{{- $listType := .ListType -}}
{{- range $key := .Keys }}
t.{{ $listName }} = make(map[{{ $key.Type }}]*{{ $listType }})
{{- end }}
{{- end }}
{{- end }} {{- end }}
}
{{ if ne .KeyStruct "" -}}
Expand Down
15 changes: 15 additions & 0 deletions ygen/gogen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,11 @@ func (E_EnumeratedValue) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumeratedValue.
func (E_EnumeratedValue) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }
// String returns a logging-friendly string for E_EnumeratedValue.
func (e E_EnumeratedValue) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumeratedValue")
}
const (
// EnumeratedValue_UNSET corresponds to the value UNSET of EnumeratedValue
EnumeratedValue_UNSET E_EnumeratedValue = 0
Expand Down Expand Up @@ -1880,6 +1885,11 @@ func (E_EnumeratedValueTwo) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumeratedValueTwo.
func (E_EnumeratedValueTwo) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }
// String returns a logging-friendly string for E_EnumeratedValueTwo.
func (e E_EnumeratedValueTwo) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumeratedValueTwo")
}
const (
// EnumeratedValueTwo_UNSET corresponds to the value UNSET of EnumeratedValueTwo
EnumeratedValueTwo_UNSET E_EnumeratedValueTwo = 0
Expand Down Expand Up @@ -1920,6 +1930,11 @@ func (E_BaseModule_Enumeration) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with BaseModule_Enumeration.
func (E_BaseModule_Enumeration) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }
// String returns a logging-friendly string for E_BaseModule_Enumeration.
func (e E_BaseModule_Enumeration) String() string {
return ygot.EnumLogString(e, int64(e), "E_BaseModule_Enumeration")
}
const (
// BaseModule_Enumeration_UNSET corresponds to the value UNSET of BaseModule_Enumeration
BaseModule_Enumeration_UNSET E_BaseModule_Enumeration = 0
Expand Down
36 changes: 36 additions & 0 deletions ygen/schema_tests/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,39 @@ func TestLeafGetter(t *testing.T) {
t.Errorf("did not correctly return the default for a leaf, got: %v, want: true", got)
}
}

func TestEnumStringFunction(t *testing.T) {
tests := []struct {
desc string
inEnum ygot.GoEnum
want string
}{{
desc: "in range: IP_REACHABILITY_TAG64",
inEnum: exampleoc.OpenconfigIsisLsdbTypes_ISIS_SUBTLV_TYPE_IP_REACHABILITY_TAG64,
want: "IP_REACHABILITY_TAG64",
}, {
desc: "in range: UP",
inEnum: exampleoc.OpenconfigInterfaces_Interface_OperStatus_UP,
want: "UP",
}, {
desc: "in range: DOWN",
inEnum: exampleoc.OpenconfigInterfaces_Interface_OperStatus_DOWN,
want: "DOWN",
}, {
desc: "out-of-range: UNSET",
inEnum: exampleoc.OpenconfigInterfaces_Interface_OperStatus_UNSET,
want: "out-of-range E_OpenconfigInterfaces_Interface_OperStatus enum value: 0",
}, {
desc: "out-of-range: too high",
inEnum: exampleoc.E_OpenconfigInterfaces_Interface_OperStatus(100),
want: "out-of-range E_OpenconfigInterfaces_Interface_OperStatus enum value: 100",
}}

for _, tt := range tests {
t.Run(tt.desc, func(t *testing.T) {
if got := tt.inEnum.String(); got != tt.want {
t.Errorf("did not get correct String() name for enum, got: %s, want: %s", got, tt.want)
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ func (E_OpenconfigOptions_AFI) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_AFI.
func (E_OpenconfigOptions_AFI) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_AFI.
func (e E_OpenconfigOptions_AFI) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_AFI")
}

const (
// OpenconfigOptions_AFI_UNSET corresponds to the value UNSET of OpenconfigOptions_AFI
OpenconfigOptions_AFI_UNSET E_OpenconfigOptions_AFI = 0
Expand All @@ -271,6 +276,11 @@ func (E_OpenconfigOptions_Neighbor_SessionState) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_Neighbor_SessionState.
func (E_OpenconfigOptions_Neighbor_SessionState) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_Neighbor_SessionState.
func (e E_OpenconfigOptions_Neighbor_SessionState) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_Neighbor_SessionState")
}

const (
// OpenconfigOptions_Neighbor_SessionState_UNSET corresponds to the value UNSET of OpenconfigOptions_Neighbor_SessionState
OpenconfigOptions_Neighbor_SessionState_UNSET E_OpenconfigOptions_Neighbor_SessionState = 0
Expand Down
10 changes: 10 additions & 0 deletions ygen/testdata/schema/openconfig-options-compress.formatted-txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ func (E_OpenconfigOptions_AFI) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_AFI.
func (E_OpenconfigOptions_AFI) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_AFI.
func (e E_OpenconfigOptions_AFI) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_AFI")
}

const (
// OpenconfigOptions_AFI_UNSET corresponds to the value UNSET of OpenconfigOptions_AFI
OpenconfigOptions_AFI_UNSET E_OpenconfigOptions_AFI = 0
Expand All @@ -249,6 +254,11 @@ func (E_OpenconfigOptions_Neighbor_SessionState) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_Neighbor_SessionState.
func (E_OpenconfigOptions_Neighbor_SessionState) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_Neighbor_SessionState.
func (e E_OpenconfigOptions_Neighbor_SessionState) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_Neighbor_SessionState")
}

const (
// OpenconfigOptions_Neighbor_SessionState_UNSET corresponds to the value UNSET of OpenconfigOptions_Neighbor_SessionState
OpenconfigOptions_Neighbor_SessionState_UNSET E_OpenconfigOptions_Neighbor_SessionState = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ func (E_OpenconfigSimple_Child_Three) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigSimple_Child_Three.
func (E_OpenconfigSimple_Child_Three) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigSimple_Child_Three.
func (e E_OpenconfigSimple_Child_Three) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigSimple_Child_Three")
}

const (
// OpenconfigSimple_Child_Three_UNSET corresponds to the value UNSET of OpenconfigSimple_Child_Three
OpenconfigSimple_Child_Three_UNSET E_OpenconfigSimple_Child_Three = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ func (E_OpenconfigOptions_AFI) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_AFI.
func (E_OpenconfigOptions_AFI) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_AFI.
func (e E_OpenconfigOptions_AFI) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_AFI")
}

const (
// OpenconfigOptions_AFI_UNSET corresponds to the value UNSET of OpenconfigOptions_AFI
OpenconfigOptions_AFI_UNSET E_OpenconfigOptions_AFI = 0
Expand All @@ -340,6 +345,11 @@ func (E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) IsYANGGoEnu
// ΛMap returns the value lookup map associated with OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState.
func (E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState.
func (e E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState")
}

const (
// OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState_UNSET corresponds to the value UNSET of OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState
OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState_UNSET E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState = 0
Expand Down
10 changes: 10 additions & 0 deletions ygen/testdata/schema/openconfig-options-nocompress.formatted-txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ func (E_OpenconfigOptions_AFI) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigOptions_AFI.
func (E_OpenconfigOptions_AFI) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_AFI.
func (e E_OpenconfigOptions_AFI) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_AFI")
}

const (
// OpenconfigOptions_AFI_UNSET corresponds to the value UNSET of OpenconfigOptions_AFI
OpenconfigOptions_AFI_UNSET E_OpenconfigOptions_AFI = 0
Expand All @@ -318,6 +323,11 @@ func (E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) IsYANGGoEnu
// ΛMap returns the value lookup map associated with OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState.
func (E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState.
func (e E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState")
}

const (
// OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState_UNSET corresponds to the value UNSET of OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState
OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState_UNSET E_OpenconfigOptions_Bgp_Neighbors_Neighbor_State_SessionState = 0
Expand Down
5 changes: 5 additions & 0 deletions ygen/testdata/structs/enum-list-uncompressed.formatted-txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func (E_EnumTestUncompressed_A_B_State_C) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumTestUncompressed_A_B_State_C.
func (E_EnumTestUncompressed_A_B_State_C) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_EnumTestUncompressed_A_B_State_C.
func (e E_EnumTestUncompressed_A_B_State_C) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumTestUncompressed_A_B_State_C")
}

const (
// EnumTestUncompressed_A_B_State_C_UNSET corresponds to the value UNSET of EnumTestUncompressed_A_B_State_C
EnumTestUncompressed_A_B_State_C_UNSET E_EnumTestUncompressed_A_B_State_C = 0
Expand Down
20 changes: 20 additions & 0 deletions ygen/testdata/structs/enum-module.formatted-txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ func (E_EnumModule_AList_Value) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumModule_AList_Value.
func (E_EnumModule_AList_Value) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_EnumModule_AList_Value.
func (e E_EnumModule_AList_Value) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumModule_AList_Value")
}

const (
// EnumModule_AList_Value_UNSET corresponds to the value UNSET of EnumModule_AList_Value
EnumModule_AList_Value_UNSET E_EnumModule_AList_Value = 0
Expand All @@ -218,6 +223,11 @@ func (E_EnumModule_BList_Value) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumModule_BList_Value.
func (E_EnumModule_BList_Value) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_EnumModule_BList_Value.
func (e E_EnumModule_BList_Value) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumModule_BList_Value")
}

const (
// EnumModule_BList_Value_UNSET corresponds to the value UNSET of EnumModule_BList_Value
EnumModule_BList_Value_UNSET E_EnumModule_BList_Value = 0
Expand All @@ -244,6 +254,11 @@ func (E_EnumModule_EnumModule_Cl) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumModule_EnumModule_Cl.
func (E_EnumModule_EnumModule_Cl) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_EnumModule_EnumModule_Cl.
func (e E_EnumModule_EnumModule_Cl) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumModule_EnumModule_Cl")
}

const (
// EnumModule_EnumModule_Cl_UNSET corresponds to the value UNSET of EnumModule_EnumModule_Cl
EnumModule_EnumModule_Cl_UNSET E_EnumModule_EnumModule_Cl = 0
Expand All @@ -266,6 +281,11 @@ func (E_EnumTypes_ID) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with EnumTypes_ID.
func (E_EnumTypes_ID) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_EnumTypes_ID.
func (e E_EnumTypes_ID) String() string {
return ygot.EnumLogString(e, int64(e), "E_EnumTypes_ID")
}

const (
// EnumTypes_ID_UNSET corresponds to the value UNSET of EnumTypes_ID
EnumTypes_ID_UNSET E_EnumTypes_ID = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (E_OpenConfigCamelCase_BAT) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenConfigCamelCase_BAT.
func (E_OpenConfigCamelCase_BAT) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenConfigCamelCase_BAT.
func (e E_OpenConfigCamelCase_BAT) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenConfigCamelCase_BAT")
}

const (
// OpenConfigCamelCase_BAT_UNSET corresponds to the value UNSET of OpenConfigCamelCase_BAT
OpenConfigCamelCase_BAT_UNSET E_OpenConfigCamelCase_BAT = 0
Expand All @@ -80,6 +85,11 @@ func (E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar.
func (E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar.
func (e E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar")
}

const (
// OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar_UNSET corresponds to the value UNSET of OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar
OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar_UNSET E_OpenConfigCamelCase_OpenconfigEnumcamelcase_Bar = 0
Expand Down
15 changes: 15 additions & 0 deletions ygen/testdata/structs/openconfig-list-enum-key.formatted-txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ func (E_OpenconfigListEnumKey_Ekm_K1) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_Ekm_K1.
func (E_OpenconfigListEnumKey_Ekm_K1) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_Ekm_K1.
func (e E_OpenconfigListEnumKey_Ekm_K1) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_Ekm_K1")
}

const (
// OpenconfigListEnumKey_Ekm_K1_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_Ekm_K1
OpenconfigListEnumKey_Ekm_K1_UNSET E_OpenconfigListEnumKey_Ekm_K1 = 0
Expand All @@ -183,6 +188,11 @@ func (E_OpenconfigListEnumKey_Eks_K) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_Eks_K.
func (E_OpenconfigListEnumKey_Eks_K) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_Eks_K.
func (e E_OpenconfigListEnumKey_Eks_K) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_Eks_K")
}

const (
// OpenconfigListEnumKey_Eks_K_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_Eks_K
OpenconfigListEnumKey_Eks_K_UNSET E_OpenconfigListEnumKey_Eks_K = 0
Expand All @@ -207,6 +217,11 @@ func (E_OpenconfigListEnumKey_FooIdentity) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_FooIdentity.
func (E_OpenconfigListEnumKey_FooIdentity) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_FooIdentity.
func (e E_OpenconfigListEnumKey_FooIdentity) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_FooIdentity")
}

const (
// OpenconfigListEnumKey_FooIdentity_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_FooIdentity
OpenconfigListEnumKey_FooIdentity_UNSET E_OpenconfigListEnumKey_FooIdentity = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ func (E_OpenconfigListEnumKey_FooIdentity) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_FooIdentity.
func (E_OpenconfigListEnumKey_FooIdentity) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_FooIdentity.
func (e E_OpenconfigListEnumKey_FooIdentity) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_FooIdentity")
}

const (
// OpenconfigListEnumKey_FooIdentity_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_FooIdentity
OpenconfigListEnumKey_FooIdentity_UNSET E_OpenconfigListEnumKey_FooIdentity = 0
Expand All @@ -545,6 +550,11 @@ func (E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1.
func (E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1.
func (e E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1")
}

const (
// OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1
OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1_UNSET E_OpenconfigListEnumKey_Top_MultiKey_Ekm_Config_K1 = 0
Expand All @@ -569,6 +579,11 @@ func (E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K) IsYANGGoEnum() {}
// ΛMap returns the value lookup map associated with OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K.
func (E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; }

// String returns a logging-friendly string for E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K.
func (e E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K) String() string {
return ygot.EnumLogString(e, int64(e), "E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K")
}

const (
// OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K_UNSET corresponds to the value UNSET of OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K
OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K_UNSET E_OpenconfigListEnumKey_Top_SingleKey_Eks_Config_K = 0
Expand Down
Loading

0 comments on commit 9150fb3

Please sign in to comment.