goalgenerator

package module
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 15 Imported by: 0

README

GoalGenerator

Documentation

Index

Constants

View Source
const Version string = "0.0.37"

Variables

View Source
var DROPDOWN_KIND = [4]string{"strings", "ints", "uints", "floats"}

Functions

func GetMoudlePath

func GetMoudlePath() (pkgPath string)

func ToLowerFirstLetter added in v0.0.10

func ToLowerFirstLetter(str string) string

func ToUpperFirstLetter added in v0.0.29

func ToUpperFirstLetter(str string) string

Types

type Field

type Field struct {
	Model *Model `yaml:"-"`
	Name  *struct {
		Value     string `yaml:",omitempty"`
		Translate `yaml:",inline,omitempty"`
	} `yaml:",omitempty"`
	Database *struct {
		PrimaryKey,
		Unique,
		Index bool `yaml:",omitempty"`
	} `yaml:",omitempty"`
	View *struct {
		Base *struct {
			Readonly,
			Postonly,
			Sortable,
			Asc,
			Desc,
			GlobalSearch,
			Filter,
			Hidden,
			Secret,
			Autowired bool `yaml:",omitempty"`
		} `yaml:",omitempty"`
		Uuid,
		Text,
		Switch,
		Password bool `yaml:",omitempty"`
		Number *struct {
			ShowButtons,
			Float,
			Uint bool `yaml:",omitempty"`
			Min,
			Max *int `yaml:",omitempty"`
		} `yaml:",omitempty"`
		File *struct {
			UploadTo string `yaml:",omitempty"`
		} `yaml:",omitempty"`
		Dropdown *struct {
			Option *struct {
				Dynamic *struct {
					Strings,
					Ints,
					Uints,
					Floats bool `yaml:",omitempty"`
				} `yaml:",omitempty"`
				Strings []struct {
					Value     string `yaml:",omitempty"`
					Translate `yaml:",inline,omitempty"`
				} `yaml:",omitempty"`
				Ints []struct {
					Value     *int `yaml:",omitempty"`
					Translate `yaml:",inline,omitempty"`
				} `yaml:",omitempty"`
				Uints []struct {
					Value     *uint `yaml:",omitempty"`
					Translate `yaml:",inline,omitempty"`
				} `yaml:",omitempty"`
				Floats []struct {
					Value     *float64 `yaml:",omitempty"`
					Translate `yaml:",inline,omitempty"`
				} `yaml:",omitempty"`
			} `yaml:",omitempty"`
			BelongTo *struct {
				Package,
				Name,
				Field string `yaml:",omitempty"`
			} `yaml:",omitempty"`
			HasOne *struct {
				Package,
				Name,
				Field string `yaml:",omitempty"`
			} `yaml:",omitempty"`
		} `yaml:",omitempty"`
		Calendar *struct {
			ShowTime,
			ShowIcon bool `yaml:",omitempty"`
		} `yaml:",omitempty"`
		Inline *struct {
			HasOne *struct {
				Package,
				Name,
				Field string `yaml:",omitempty"`
			} `yaml:",omitempty"`
			HasMany *struct {
				Package,
				Name string `yaml:",omitempty"`
			} `yaml:",omitempty"`
		} `yaml:",omitempty"`
		MultiSelect *struct {
			Many2Many *struct {
				Package,
				Name,
				Field string `yaml:",omitempty"`
			} `yaml:"many2many,omitempty"`
		} `yaml:",omitempty"`
	} `yaml:",omitempty"`
	Validator *struct {
		Required,
		Email,
		Alphanum,
		Alpha bool `yaml:",omitempty"`
		Min,
		Max,
		Len *int `yaml:",omitempty"`
	} `yaml:",omitempty"`
}

func (*Field) Component

func (f *Field) Component() (c string)

func (*Field) Dropdown added in v0.0.29

func (f *Field) Dropdown(kind string, dynamic bool) (ok bool)

func (*Field) DropdownLabels added in v0.0.29

func (f *Field) DropdownLabels(kind string) string

func (*Field) DropdownOptions added in v0.0.29

func (f *Field) DropdownOptions(kind string) string

func (*Field) DropdownTranslateOptionMethod added in v0.0.27

func (f *Field) DropdownTranslateOptionMethod() string

func (*Field) Tag

func (f *Field) Tag() (tag string)

func (*Field) Type

func (f *Field) Type() (t string)

type IValid

type IValid interface {
	Valid() error
}

type Model

type Model struct {
	Package *struct {
		Value     string `yaml:",omitempty"`
		Translate `yaml:",inline,omitempty"`
	} `yaml:",omitempty"`
	Name *struct {
		Value     string `yaml:",omitempty"`
		Translate `yaml:",inline,omitempty"`
	} `yaml:",omitempty"`
	Database *struct {
		EmbeddingBase,
		Purge bool `yaml:",omitempty"`
		TableName string `yaml:",omitempty"`
	} `yaml:",omitempty"`
	View *struct {
		Lazy,
		Ctrl bool `yaml:",omitempty"`
		Icon string `yaml:",omitempty"`
	} `yaml:",omitempty"`
	Fields []Field `yaml:",omitempty"`
}

func (*Model) Ctrl added in v0.0.18

func (m *Model) Ctrl() bool

func (*Model) CustomTableName added in v0.0.18

func (m *Model) CustomTableName() bool

func (*Model) Dropdowns added in v0.0.17

func (m *Model) Dropdowns() (fields []Field)

func (*Model) EmbeddingBase

func (m *Model) EmbeddingBase() bool

func (*Model) Gen added in v0.0.10

func (m *Model) Gen() error

func (*Model) Icon added in v0.0.20

func (m *Model) Icon() string

func (*Model) Imports

func (m *Model) Imports() (imports []string)

func (*Model) Lazy

func (m *Model) Lazy() bool

func (*Model) Purge added in v0.0.18

func (m *Model) Purge() bool

func (*Model) TableName added in v0.0.18

func (m *Model) TableName() string

func (*Model) Valid

func (m *Model) Valid() error

Valid implements IValid

func (*Model) Version added in v0.0.2

func (m *Model) Version() string

type Translate added in v0.0.21

type Translate struct {
	En   string `yaml:",omitempty"`
	ZhCN string `yaml:"zh-CN,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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