model

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeInt       = newType("int")
	TypeMap       = newType("map", "json", "jsonb")
	TypeString    = newType("string", "text")
	TypeTimestamp = newType("timestamp", "datetime")
	TypeUUID      = newType("uuid")
	AllTypes      = []*Type{TypeInt, TypeMap, TypeString, TypeTimestamp, TypeUUID}
)

Functions

func ColToString

func ColToString(c *Column, prefix string) string

func ColToViewString

func ColToViewString(c *Column, prefix string) string

func TypeToString

func TypeToString(t *Type, prop string) string

func TypeToViewString

func TypeToViewString(t *Type, prop string, nullable bool) string

Types

type Args

type Args struct {
	Config  util.ValueMap `json:"config,omitempty"`
	Models  Models        `json:"models,omitempty"`
	Modules []string      `json:"-"`
}

func (*Args) HasModule

func (a *Args) HasModule(key string) bool

type Column

type Column struct {
	Name     string `json:"name"`
	Type     *Type  `json:"type"`
	PK       bool   `json:"pk,omitempty"`
	Nullable bool   `json:"nullable,omitempty"`
	Search   bool   `json:"search,omitempty"`
}

func (*Column) Camel

func (c *Column) Camel() string

func (*Column) Help added in v0.1.27

func (c *Column) Help() string

func (*Column) Proper

func (c *Column) Proper() string

func (*Column) ToGoDTOType

func (c *Column) ToGoDTOType() string

func (*Column) ToGoEditString

func (c *Column) ToGoEditString(prefix string) string

func (*Column) ToGoMapParse

func (c *Column) ToGoMapParse() string

func (*Column) ToGoString

func (c *Column) ToGoString(prefix string) string

func (*Column) ToGoType

func (c *Column) ToGoType() string

func (*Column) ToGoViewString

func (c *Column) ToGoViewString(prefix string) string

func (*Column) ZeroVal

func (c *Column) ZeroVal() string

type Columns

type Columns []*Column

func (Columns) Args

func (c Columns) Args() string

func (Columns) CamelNames

func (c Columns) CamelNames() []string

func (Columns) Get

func (c Columns) Get(name string) *Column

func (Columns) GoDTOTypeKeys

func (c Columns) GoDTOTypeKeys() []string

func (Columns) GoTypeKeys

func (c Columns) GoTypeKeys() []string

func (Columns) MaxGoDTOKeyLength

func (c Columns) MaxGoDTOKeyLength() int

func (Columns) MaxGoKeyLength

func (c Columns) MaxGoKeyLength() int

func (Columns) Names

func (c Columns) Names() []string

func (Columns) NamesQuoted

func (c Columns) NamesQuoted() []string

func (Columns) PKs

func (c Columns) PKs() Columns

func (Columns) Refs

func (c Columns) Refs() string

func (Columns) Searches

func (c Columns) Searches() Columns

func (Columns) Smushed

func (c Columns) Smushed() string

func (Columns) Types

func (c Columns) Types() Types

func (Columns) WhereClause

func (c Columns) WhereClause() interface{}

func (Columns) ZeroVals

func (c Columns) ZeroVals() []string

type Model

type Model struct {
	Name        string   `json:"name"`
	Package     string   `json:"package"`
	Description string   `json:"description"`
	Icon        string   `json:"icon"`
	Ordering    string   `json:"ordering"`
	Search      []string `json:"search"`
	Columns     Columns  `json:"columns"`
}

func (*Model) Camel

func (m *Model) Camel() string

func (*Model) ClassRef

func (m *Model) ClassRef() string

func (*Model) FirstLetter

func (m *Model) FirstLetter() string

func (*Model) Help added in v0.1.27

func (m *Model) Help() string

func (*Model) IconSafe

func (m *Model) IconSafe() string

func (*Model) LinkURL

func (m *Model) LinkURL(prefix string) string

func (*Model) PackageProper

func (m *Model) PackageProper() string

func (*Model) Proper

func (m *Model) Proper() string

func (*Model) ProperPlural

func (m *Model) ProperPlural() string

func (*Model) URLPath

func (m *Model) URLPath(prefix string) string

type Models

type Models []*Model

type Type

type Type struct {
	Key   string
	Names []string
}

func TypeFromString

func TypeFromString(s string) (*Type, error)

func (*Type) Help added in v0.1.27

func (t *Type) Help() string

func (*Type) MarshalJSON

func (t *Type) MarshalJSON() ([]byte, error)

func (*Type) String

func (t *Type) String() string

func (*Type) ToGoDTOType

func (t *Type) ToGoDTOType(nullable bool) string

func (*Type) ToGoString

func (t *Type) ToGoString(prop string) string

func (*Type) ToGoType

func (t *Type) ToGoType(nullable bool) string

func (*Type) ToGoViewString

func (t *Type) ToGoViewString(prop string, nullable bool) string

func (*Type) UnmarshalJSON

func (t *Type) UnmarshalJSON(data []byte) error

type Types

type Types []*Type

Jump to

Keyboard shortcuts

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