radix

package
v1.2.115 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RadixSliceContains

func RadixSliceContains(enums []Radix, sunEnums ...Radix) bool

RadixSliceContains reports whether sunEnums is within enums.

func RadixSliceContainsAny

func RadixSliceContainsAny(enums []Radix, sunEnums ...Radix) bool

RadixSliceContainsAny reports whether any sunEnum is within enums.

Types

type Radix

type Radix int // 进制
const (
	Binary      Radix = iota // 二进制
	Octonary                 // 八进制
	Decimal                  // 十进制
	Hexadecimal              // 十六进制
)

func ParseRadixString

func ParseRadixString(s string) (Radix, error)

ParseRadixString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func RadixValues

func RadixValues() []Radix

RadixValues returns all values of the enum

func (Radix) MarshalBinary

func (i Radix) MarshalBinary() (data []byte, err error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Radix

func (Radix) MarshalJSON

func (i Radix) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Radix

func (Radix) MarshalText

func (i Radix) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Radix

func (Radix) MarshalYAML

func (i Radix) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Radix

func (Radix) Registered

func (i Radix) Registered() bool

IsARadix returns "true" if the value is listed in the enum definition. "false" otherwise

func (*Radix) Scan

func (i *Radix) Scan(value interface{}) error

func (Radix) String

func (i Radix) String() string

func (*Radix) UnmarshalBinary

func (i *Radix) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Radix

func (*Radix) UnmarshalJSON

func (i *Radix) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Radix

func (*Radix) UnmarshalText

func (i *Radix) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Radix

func (*Radix) UnmarshalYAML

func (i *Radix) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for Radix

func (Radix) Value

func (i Radix) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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