field

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

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