enum

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Valid

func Valid[T ~string](options []T, value T) error

Types

type Enum

type Enum[T ~string] interface {
	Options() []T
	Valid() error
}

type InvalidEnumMemberError

type InvalidEnumMemberError struct {
	Options []string
	Value   string
}

func (InvalidEnumMemberError) Error

func (err InvalidEnumMemberError) Error() string

Jump to

Keyboard shortcuts

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