enum

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownValue = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Value int
	Name  string
}

type Wrapper

type Wrapper struct {
	TypeName string
	// contains filtered or unexported fields
}

func NewEnumWrapper

func NewEnumWrapper(typeName string, enums ...Item) *Wrapper

func (*Wrapper) GetName

func (e *Wrapper) GetName(value int) string

func (*Wrapper) GetValue

func (e *Wrapper) GetValue(name string) int

func (*Wrapper) MarshalJSONInner

func (e *Wrapper) MarshalJSONInner(value int) ([]byte, error)

func (*Wrapper) UnmarshalJSONInner

func (e *Wrapper) UnmarshalJSONInner(data []byte) (value int, err error)

Jump to

Keyboard shortcuts

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