enum_test

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 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

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
)

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