test

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package test ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnumStrings

func EnumStrings() []string

EnumStrings returns a slice of all String values of the enum

Types

type Enum

type Enum int
const (
	EnumOne Enum = iota
	EnumTwo
	EnumThree
)

func EnumString

func EnumString(s string) (Enum, error)

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

func EnumValues

func EnumValues() []Enum

EnumValues returns all values of the enum

func (Enum) IsAEnum

func (i Enum) IsAEnum() bool

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

func (Enum) MarshalJSON added in v0.2.1

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

MarshalJSON implements the json.Marshaler interface for Enum

func (Enum) String

func (i Enum) String() string

func (*Enum) UnmarshalJSON added in v0.2.1

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

UnmarshalJSON implements the json.Unmarshaler interface for Enum

func (Enum) Values

func (Enum) Values() []string

Jump to

Keyboard shortcuts

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