enum_test

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Status_name name map
	Status_name = map[Status]string{
		Running: "running",
	}

	// Status_value value map
	Status_value = map[string]Status{
		"running": Running,
	}
)
View Source
var (
	// Enum_name name map
	Enum_name = map[Enum]string{
		E1: "e1",
	}

	// Enum_value value map
	Enum_value = map[string]Enum{
		"e1": E1,
	}
)

Functions

This section is empty.

Types

type Enum

type Enum uint
const (
	// Running  todo
	E1 Enum = iota
	// Running (中文测试) todo
	E2
)

func ParseEnumFromString

func ParseEnumFromString(str string) (Enum, error)

ParseEnumFromString Parse Enum from string

func (Enum) Equal

func (t Enum) Equal(target Enum) bool

Equal type compare

func (Enum) IsIn

func (t Enum) IsIn(targets ...Enum) bool

IsIn todo

func (Enum) MarshalJSON

func (t Enum) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (Enum) String

func (t Enum) String() string

String stringer

func (*Enum) UnmarshalJSON

func (t *Enum) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

type Status

type Status uint

Status AAA BBB

const (
	// Running (running) todo
	Running Status = iota
	// Stopping (stopping) tdo
	Stopping
	// Stopped (stopped) todo
	Stopped
	// Canceled (canceled) todo
	Canceled

	Test11
)

func ParseStatusFromString

func ParseStatusFromString(str string) (Status, error)

ParseStatusFromString Parse Status from string

func (Status) Equal

func (t Status) Equal(target Status) bool

Equal type compare

func (Status) IsIn

func (t Status) IsIn(targets ...Status) bool

IsIn todo

func (Status) MarshalJSON

func (t Status) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (Status) String

func (t Status) String() string

String stringer

func (*Status) UnmarshalJSON

func (t *Status) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

Jump to

Keyboard shortcuts

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