enum_test

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package enum_test for test

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

Enum tood

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

func ParseEnumFromString added in v1.3.4

func ParseEnumFromString(str string) (Enum, error)

ParseEnumFromString Parse Enum from string

func (Enum) Equal added in v1.3.4

func (t Enum) Equal(target Enum) bool

Equal type compare

func (Enum) IsIn added in v1.3.4

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

IsIn todo

func (Enum) MarshalJSON added in v1.3.4

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

MarshalJSON todo

func (Enum) String added in v1.3.4

func (t Enum) String() string

String stringer

func (*Enum) UnmarshalJSON added in v1.3.4

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
)

func ParseStatusFromString added in v1.3.4

func ParseStatusFromString(str string) (Status, error)

ParseStatusFromString Parse Status from string

func (Status) Equal added in v1.3.4

func (t Status) Equal(target Status) bool

Equal type compare

func (Status) IsIn added in v1.3.4

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

IsIn todo

func (Status) MarshalJSON added in v1.3.4

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

MarshalJSON todo

func (Status) String added in v1.3.4

func (t Status) String() string

String stringer

func (*Status) UnmarshalJSON added in v1.3.4

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