enum

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code2Text

func Code2Text[T ElemType](enumPtr interface{}) map[T]string

func CodeSet

func CodeSet[T ElemType](enumPtr interface{}) set.Set[T]

func ID2NameList

func ID2NameList(enumPtr interface{}) []map[string]interface{}

ID2NameList 返回数据结构为:

[{
     "id": enum code,
     "name": enum text
 },{
     ...
 }]

func New

func New[T any]() *T

Types

type Elem

type Elem[T ElemType] struct {
	Code T
	Text string
}

type ElemType added in v1.3.2

type ElemType interface {
	int | string
}

Jump to

Keyboard shortcuts

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