enum

package
v1.5.35 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 6 Imported by: 0

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"`
	Schema         string        `json:"schema,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"`
	// contains filtered or unexported fields
}

func (*Enum) AddTag added in v1.5.16

func (e *Enum) AddTag(t string)

func (*Enum) Breadcrumbs

func (e *Enum) Breadcrumbs() string

func (*Enum) Camel

func (e *Enum) Camel() string

func (*Enum) CamelLower added in v1.5.31

func (e *Enum) CamelLower() string

func (*Enum) Clone added in v1.5.16

func (e *Enum) Clone() *Enum

func (*Enum) ExtraFieldValues

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

func (*Enum) ExtraFields

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

func (*Enum) FirstLetter

func (e *Enum) FirstLetter() any

func (*Enum) HasTag

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

func (*Enum) HasValueIcons added in v1.5.15

func (e *Enum) HasValueIcons() 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

func (e *Enum) ProperPlural() string

func (*Enum) SetAcronyms added in v1.4.3

func (e *Enum) SetAcronyms(acronyms ...string)

func (*Enum) Simple

func (e *Enum) Simple() bool

func (*Enum) SkipDatabase added in v1.5.22

func (e *Enum) SkipDatabase() bool

func (*Enum) SkipGolang added in v1.5.23

func (e *Enum) SkipGolang() bool

func (*Enum) Title

func (e *Enum) Title() string

func (*Enum) TitleLower

func (e *Enum) TitleLower() string

func (*Enum) ValuesCamel

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

type Enums

type Enums []*Enum

func (Enums) Clone added in v1.5.16

func (e Enums) Clone() Enums

func (Enums) Get

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

func (Enums) WithDatabase added in v1.5.22

func (e Enums) WithDatabase() Enums

func (Enums) WithTag added in v1.5.22

func (e Enums) WithTag(tag string) Enums

func (Enums) WithTypeScript added in v1.5.23

func (e Enums) WithTypeScript() Enums

func (Enums) WithoutTag added in v1.5.22

func (e Enums) WithoutTag(tag string) Enums

type Value

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

func (*Value) Clone added in v1.5.16

func (x *Value) Clone() *Value

func (*Value) MarshalJSON

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

func (*Value) Proper

func (x *Value) Proper() string

func (*Value) Title

func (x *Value) Title() string

func (*Value) UnmarshalJSON

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

type Values

type Values []*Value

func (Values) AllSimple

func (v Values) AllSimple() bool

func (Values) Clone added in v1.5.16

func (v Values) Clone() Values

func (Values) Default

func (v Values) Default() *Value

func (Values) Keys

func (v Values) Keys() []string

func (Values) Names

func (v Values) Names() []string

func (Values) Titles

func (v Values) Titles() []string

Jump to

Keyboard shortcuts

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