animals

package
v0.0.0-...-0821d35 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoValidEnum = errors.New("not a valid enum")
)

Functions

func AnimalStrings

func AnimalStrings() []string

AnimalStrings returns a slice of all String values of the enum.

func BirdStrings

func BirdStrings() []string

BirdStrings returns a slice of all String values of the enum.

func FishStrings

func FishStrings() []string

FishStrings returns a slice of all String values of the enum.

func MammalStrings

func MammalStrings() []string

MammalStrings returns a slice of all String values of the enum.

func ReptileStrings

func ReptileStrings() []string

ReptileStrings returns a slice of all String values of the enum.

Types

type Animal

type Animal uint8
const (
	AnimalDog Animal = iota
	AnimalCat
	AnimalSeal
	AnimalSeaLion
	AnimalIceBear
)

func AnimalFromString

func AnimalFromString(raw string) (Animal, bool)

AnimalFromString determines the enum value with an exact case match.

func AnimalFromStringIgnoreCase

func AnimalFromStringIgnoreCase(raw string) (Animal, bool)

AnimalFromStringIgnoreCase determines the enum value with a case-insensitive match.

func AnimalValues

func AnimalValues() []Animal

AnimalValues returns all values of the enum.

func (Animal) IsValid

func (_a Animal) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (Animal) MarshalBinary

func (_a Animal) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Animal.

func (Animal) MarshalGQL

func (_a Animal) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for Animal.

func (Animal) MarshalJSON

func (_a Animal) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Animal.

func (Animal) MarshalText

func (_a Animal) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Animal.

func (Animal) MarshalYAML

func (_a Animal) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Animal.

func (*Animal) Scan

func (_a *Animal) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for Animal.

func (Animal) String

func (_a Animal) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Animal(%d) instead.

func (*Animal) UnmarshalBinary

func (_a *Animal) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Animal.

func (*Animal) UnmarshalGQL

func (_a *Animal) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for Animal.

func (*Animal) UnmarshalJSON

func (_a *Animal) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Animal.

func (*Animal) UnmarshalText

func (_a *Animal) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Animal.

func (*Animal) UnmarshalYAML

func (_a *Animal) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements a YAML Unmarshaler for Animal.

func (Animal) Validate

func (_a Animal) Validate() error

Validate whether the value is within the range of enum values.

func (Animal) Value

func (_a Animal) Value() (driver.Value, error)

Value implements the sql/driver.Valuer interface for Animal.

type Bird

type Bird uint8
const (
	BirdAlbatross Bird = iota
	BirdHummingBird
	BirdDarwinsFinch
	BirdOstrich
	BirdKingFisher
)

func BirdFromString

func BirdFromString(raw string) (Bird, bool)

BirdFromString determines the enum value with an exact case match.

func BirdFromStringIgnoreCase

func BirdFromStringIgnoreCase(raw string) (Bird, bool)

BirdFromStringIgnoreCase determines the enum value with a case-insensitive match.

func BirdValues

func BirdValues() []Bird

BirdValues returns all values of the enum.

func (Bird) IsValid

func (_b Bird) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (Bird) MarshalBinary

func (_b Bird) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Bird.

func (Bird) MarshalGQL

func (_b Bird) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for Bird.

func (Bird) MarshalJSON

func (_b Bird) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Bird.

func (Bird) MarshalText

func (_b Bird) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Bird.

func (Bird) MarshalYAML

func (_b Bird) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Bird.

func (*Bird) Scan

func (_b *Bird) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for Bird.

func (Bird) String

func (_b Bird) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Bird(%d) instead.

func (*Bird) UnmarshalBinary

func (_b *Bird) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Bird.

func (*Bird) UnmarshalGQL

func (_b *Bird) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for Bird.

func (*Bird) UnmarshalJSON

func (_b *Bird) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Bird.

func (*Bird) UnmarshalText

func (_b *Bird) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Bird.

func (*Bird) UnmarshalYAML

func (_b *Bird) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements a YAML Unmarshaler for Bird.

func (Bird) Validate

func (_b Bird) Validate() error

Validate whether the value is within the range of enum values.

func (Bird) Value

func (_b Bird) Value() (driver.Value, error)

Value implements the sql/driver.Valuer interface for Bird.

type Fish

type Fish uint8
const (
	FishGiantGrouper Fish = iota
	FishHagfish
	FishReedfish
	FishBowfin
	FishCatfish
	FishHornShark
)

func FishFromString

func FishFromString(raw string) (Fish, bool)

FishFromString determines the enum value with an exact case match.

func FishFromStringIgnoreCase

func FishFromStringIgnoreCase(raw string) (Fish, bool)

FishFromStringIgnoreCase determines the enum value with a case-insensitive match.

func FishValues

func FishValues() []Fish

FishValues returns all values of the enum.

func (Fish) IsValid

func (_f Fish) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (Fish) MarshalBinary

func (_f Fish) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Fish.

func (Fish) MarshalGQL

func (_f Fish) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for Fish.

func (Fish) MarshalJSON

func (_f Fish) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Fish.

func (Fish) MarshalText

func (_f Fish) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Fish.

func (Fish) MarshalYAML

func (_f Fish) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Fish.

func (*Fish) Scan

func (_f *Fish) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for Fish.

func (Fish) String

func (_f Fish) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Fish(%d) instead.

func (*Fish) UnmarshalBinary

func (_f *Fish) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Fish.

func (*Fish) UnmarshalGQL

func (_f *Fish) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for Fish.

func (*Fish) UnmarshalJSON

func (_f *Fish) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Fish.

func (*Fish) UnmarshalText

func (_f *Fish) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Fish.

func (*Fish) UnmarshalYAML

func (_f *Fish) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements a YAML Unmarshaler for Fish.

func (Fish) Validate

func (_f Fish) Validate() error

Validate whether the value is within the range of enum values.

func (Fish) Value

func (_f Fish) Value() (driver.Value, error)

Value implements the sql/driver.Valuer interface for Fish.

type Mammal

type Mammal uint8
const (
	MammalBumblebeeBat Mammal = iota
	MammalBlueWhale
	MammalBowheadWhale
)

func MammalFromString

func MammalFromString(raw string) (Mammal, bool)

MammalFromString determines the enum value with an exact case match.

func MammalFromStringIgnoreCase

func MammalFromStringIgnoreCase(raw string) (Mammal, bool)

MammalFromStringIgnoreCase determines the enum value with a case-insensitive match.

func MammalValues

func MammalValues() []Mammal

MammalValues returns all values of the enum.

func (Mammal) IsValid

func (_m Mammal) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (Mammal) MarshalBinary

func (_m Mammal) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Mammal.

func (Mammal) MarshalGQL

func (_m Mammal) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for Mammal.

func (Mammal) MarshalJSON

func (_m Mammal) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Mammal.

func (Mammal) MarshalText

func (_m Mammal) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Mammal.

func (Mammal) MarshalYAML

func (_m Mammal) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Mammal.

func (*Mammal) Scan

func (_m *Mammal) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for Mammal.

func (Mammal) String

func (_m Mammal) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Mammal(%d) instead.

func (*Mammal) UnmarshalBinary

func (_m *Mammal) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Mammal.

func (*Mammal) UnmarshalGQL

func (_m *Mammal) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for Mammal.

func (*Mammal) UnmarshalJSON

func (_m *Mammal) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Mammal.

func (*Mammal) UnmarshalText

func (_m *Mammal) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Mammal.

func (*Mammal) UnmarshalYAML

func (_m *Mammal) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements a YAML Unmarshaler for Mammal.

func (Mammal) Validate

func (_m Mammal) Validate() error

Validate whether the value is within the range of enum values.

func (Mammal) Value

func (_m Mammal) Value() (driver.Value, error)

Value implements the sql/driver.Valuer interface for Mammal.

type Reptile

type Reptile uint8
const (
	ReptileSaltwaterCrocodile Reptile = iota
	ReptileBeardedDragon
	ReptileChameleon
	ReptileComodoDragon
)

func ReptileFromString

func ReptileFromString(raw string) (Reptile, bool)

ReptileFromString determines the enum value with an exact case match.

func ReptileFromStringIgnoreCase

func ReptileFromStringIgnoreCase(raw string) (Reptile, bool)

ReptileFromStringIgnoreCase determines the enum value with a case-insensitive match.

func ReptileValues

func ReptileValues() []Reptile

ReptileValues returns all values of the enum.

func (Reptile) IsValid

func (_r Reptile) IsValid() bool

IsValid tests whether the value is a valid enum value.

func (Reptile) MarshalBinary

func (_r Reptile) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface for Reptile.

func (Reptile) MarshalGQL

func (_r Reptile) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for Reptile.

func (Reptile) MarshalJSON

func (_r Reptile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Reptile.

func (Reptile) MarshalText

func (_r Reptile) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Reptile.

func (Reptile) MarshalYAML

func (_r Reptile) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Reptile.

func (*Reptile) Scan

func (_r *Reptile) Scan(value interface{}) error

Scan implements the sql/driver.Scanner interface for Reptile.

func (Reptile) String

func (_r Reptile) String() string

String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Reptile(%d) instead.

func (*Reptile) UnmarshalBinary

func (_r *Reptile) UnmarshalBinary(text []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Reptile.

func (*Reptile) UnmarshalGQL

func (_r *Reptile) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for Reptile.

func (*Reptile) UnmarshalJSON

func (_r *Reptile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Reptile.

func (*Reptile) UnmarshalText

func (_r *Reptile) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Reptile.

func (*Reptile) UnmarshalYAML

func (_r *Reptile) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML implements a YAML Unmarshaler for Reptile.

func (Reptile) Validate

func (_r Reptile) Validate() error

Validate whether the value is within the range of enum values.

func (Reptile) Value

func (_r Reptile) Value() (driver.Value, error)

Value implements the sql/driver.Valuer interface for Reptile.

Jump to

Keyboard shortcuts

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