enumeration

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnumMap = map[string]Enum{}
View Source
var InvalidBool = errors.New("invalid Bool")

Functions

func AsInt64

func AsInt64(v interface{}, defaultInteger int64) (int64, error)

func RegisterEnum

func RegisterEnum(enumType string, optionValue string, label string)

@deprecated

func RegisterEnums

func RegisterEnums(enumType string, values map[string]string)

Types

type Bool

type Bool uint8

swagger:enum

const (
	BOOL_UNKNOWN Bool = iota
	BOOL__TRUE        // true
	BOOL__FALSE       // false
)

func BoolFromBool

func BoolFromBool(b bool) Bool

func ParseBoolFromLabelString

func ParseBoolFromLabelString(s string) (Bool, error)

func ParseBoolFromString

func ParseBoolFromString(s string) (Bool, error)

func (Bool) Enums

func (Bool) Enums() map[int][]string

func (Bool) Label

func (v Bool) Label() string

func (Bool) MarshalJSON

func (v Bool) MarshalJSON() ([]byte, error)

func (Bool) MarshalText

func (v Bool) MarshalText() ([]byte, error)

func (Bool) String

func (v Bool) String() string

func (Bool) True

func (v Bool) True() bool

func (*Bool) UnmarshalJSON

func (v *Bool) UnmarshalJSON(data []byte) (err error)

func (*Bool) UnmarshalText

func (v *Bool) UnmarshalText(data []byte) (err error)

type Enum

type Enum []EnumOption

type EnumOption

type EnumOption struct {
	Val   interface{} `json:"val"`
	Value interface{} `json:"value"`
	Label string      `json:"label"`
}

func GetEnumValueList

func GetEnumValueList(enumType string) (enumList []EnumOption, found bool)

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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