enumx

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package enumx is the catalog of the enums of a project: every allowed value of a status, a provider or a type with its description, for clients and for validation. The catalog is generated from the go-enum markers of the domain package, as in taply.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog []Entity

Catalog is every enum of the project, ordered as the markers ask.

func (Catalog) Find

func (c Catalog) Find(entity, name string) (Enum, bool)

Find returns an enum by entity and name.

func (Catalog) Valid

func (c Catalog) Valid(entity, name, value string) bool

Valid reports whether a value is allowed for an enum, for validating input.

type Entity

type Entity struct {
	Entity      string `json:"entity"`
	Description string `json:"description"`
	Enums       []Enum `json:"enums"`
}

Entity groups the enums of one domain entity.

type Enum

type Enum struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Values      []Value `json:"values"`
}

Enum is one enum of an entity, such as the status of an order.

type Value

type Value struct {
	Value       string `json:"value"`
	Description string `json:"description"`
}

Value is one allowed value.

Jump to

Keyboard shortcuts

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