enum

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExampleValues = Values{{Key: "x", Name: "X", Description: "It's an x", Icon: "x-icon", Default: false, Simple: false}}

	Examples = map[string]any{
		"values": ExampleValues,
	}
)
View Source
var ValueFieldDescs = util.FieldDescs{
	{Key: "key", Title: "Key", Description: "The key of the enum"},
	{Key: "name", Title: "Name", Description: "The name of the enum"},
	{Key: "description", Title: "Description", Description: "The description of the enum"},
	{Key: "icon", Title: "Icon", Description: "The icon of the enum", Type: "icon"},
	{Key: "default", Title: "Default", Description: "Indicates if this is the default value", Type: "bool"},
}

Functions

This section is empty.

Types

type Enum

type Enum struct {
	Name           string        `json:"name"`
	Package        string        `json:"package"`
	Group          []string      `json:"group,omitempty"`
	Description    string        `json:"description,omitempty"`
	Icon           string        `json:"icon,omitempty"`
	Values         Values        `json:"values,omitempty"`
	Tags           []string      `json:"tags,omitempty"`
	TitleOverride  string        `json:"title,omitempty"`
	ProperOverride string        `json:"proper,omitempty"`
	RouteOverride  string        `json:"route,omitempty"`
	Config         util.ValueMap `json:"config,omitempty"`
}

func (*Enum) Breadcrumbs

func (e *Enum) Breadcrumbs() string

func (*Enum) Camel

func (e *Enum) Camel() string

func (*Enum) ExtraFieldValues added in v1.0.12

func (e *Enum) ExtraFieldValues(k string) ([]any, bool)

func (*Enum) ExtraFields added in v1.0.7

func (e *Enum) ExtraFields() *util.OrderedMap[string]

func (*Enum) FirstLetter added in v1.0.5

func (e *Enum) FirstLetter() any

func (*Enum) HasTag

func (e *Enum) HasTag(t string) bool

func (*Enum) IconSafe

func (e *Enum) IconSafe() string

func (*Enum) PackageWithGroup

func (e *Enum) PackageWithGroup(prefix string) string

func (*Enum) Proper

func (e *Enum) Proper() string

func (*Enum) ProperPlural added in v1.0.5

func (e *Enum) ProperPlural() string

func (*Enum) Simple added in v1.0.5

func (e *Enum) Simple() bool

func (*Enum) Title

func (e *Enum) Title() string

func (*Enum) ValuesCamel added in v0.7.20

func (e *Enum) ValuesCamel() []string

type Enums

type Enums []*Enum

func (Enums) Get

func (e Enums) Get(key string) *Enum

type Value added in v1.0.5

type Value struct {
	Key         string
	Name        string
	Description string
	Icon        string
	Extra       *util.OrderedMap[any]
	Default     bool
	Simple      bool
}

func (*Value) MarshalJSON added in v1.0.5

func (x *Value) MarshalJSON() ([]byte, error)

func (*Value) Proper added in v1.0.6

func (x *Value) Proper() string

func (*Value) Title added in v1.0.5

func (x *Value) Title() string

func (*Value) UnmarshalJSON added in v1.0.5

func (x *Value) UnmarshalJSON(data []byte) error

type Values added in v1.0.5

type Values []*Value

func (Values) AllSimple added in v1.0.5

func (v Values) AllSimple() bool

func (Values) Default added in v1.0.6

func (v Values) Default() *Value

func (Values) Keys added in v1.0.5

func (v Values) Keys() []string

func (Values) Titles added in v1.0.5

func (v Values) Titles() []string

Jump to

Keyboard shortcuts

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