field

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 4 Imported by: ? 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

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Key      string         `json:"key"`
	Type     *types.Wrapped `json:"type"`
	Title    string         `json:"-"` // override only
	Plural   string         `json:"-"` // override only
	Hidden   bool           `json:"-"` // override only
	Default  any            `json:"default,omitempty"`
	ReadOnly bool           `json:"readOnly,omitempty"`
	Metadata *Metadata      `json:"metadata,omitempty"`
}

func NewFieldByType

func NewFieldByType(key string, t reflect.Type, ro bool, md *Metadata) *Field

func (*Field) DefaultClean

func (f *Field) DefaultClean() any

func (*Field) Description

func (f *Field) Description() string

func (*Field) Name

func (f *Field) Name() string

func (*Field) PluralName

func (f *Field) PluralName() string

func (*Field) String

func (f *Field) String() string

type Fields

type Fields []*Field

func (Fields) Get

func (s Fields) Get(key string) (int, *Field)

func (Fields) Names

func (s Fields) Names() []string

type Metadata

type Metadata struct {
	Description string   `json:"description,omitempty"`
	Comments    []string `json:"comments,omitempty"`
	Source      string   `json:"source,omitempty"`
	Line        int      `json:"line,omitempty"`
	Column      int      `json:"column,omitempty"`
}

Jump to

Keyboard shortcuts

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