model

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prefix, Suffix string

Functions

This section is empty.

Types

type Config

type Config struct {
	MainType       string
	Plural, Pkg    string
	MarshalTextRep enum.Representation
	StoreRep       enum.Representation
	IgnoreCase     bool
	Unsnake        bool
	Lenient        bool
}

Config contains the model parameters obtained from command line options (either directly or computed).

type Model

type Model struct {
	Config
	LcType, BaseType string
	Version          string
	Values           Values
	Case             transform.Case
	TagTable         string
	AliasTable       string
	Extra            map[string]string
}

Model holds the information available during template evaluation.

func (Model) AllItemsSlice

func (m Model) AllItemsSlice() string

func (Model) Asymmetric

func (m Model) Asymmetric() bool

func (Model) BaseKind

func (m Model) BaseKind() types.BasicKind

func (Model) CheckBadPrefixSuffix

func (m Model) CheckBadPrefixSuffix() error

func (Model) CheckBadTags added in v2.12.0

func (m Model) CheckBadTags() error

func (Model) FnMap

func (m Model) FnMap() template.FuncMap

func (Model) HasJSONTags added in v2.12.0

func (m Model) HasJSONTags() bool

func (Model) HasSQLTags added in v2.12.0

func (m Model) HasSQLTags() bool

func (Model) Indexes

func (m Model) Indexes() string

func (Model) InputCase

func (m Model) InputCase() transform.Case

func (Model) InputJSONValues added in v2.12.0

func (m Model) InputJSONValues() []string

func (Model) InputSQLValues added in v2.12.0

func (m Model) InputSQLValues() []string

func (Model) IsFloat

func (m Model) IsFloat() bool

func (Model) JSONIndexes added in v2.12.0

func (m Model) JSONIndexes() string

func (Model) OutputJSONValues added in v2.12.0

func (m Model) OutputJSONValues() []string

func (Model) OutputSQLValues added in v2.12.0

func (m Model) OutputSQLValues() []string

func (Model) Placeholder

func (m Model) Placeholder() string

func (Model) SQLIndexes added in v2.12.0

func (m Model) SQLIndexes() string

func (Model) TransformedInputValues

func (m Model) TransformedInputValues() []string

func (Model) TransformedOutputValues

func (m Model) TransformedOutputValues() []string

func (Model) ValuesJoined

func (m Model) ValuesJoined(from int, separator string) string

func (Model) ValuesWithWrapping

func (m Model) ValuesWithWrapping(nTabs int) string

func (Model) WriteGo added in v2.10.0

func (m Model) WriteGo(w io.Writer)

type Value added in v2.12.0

type Value struct {
	Identifier string
	Shortened  string
	JSON, SQL  string
}

type Values added in v2.12.0

type Values []Value

func ValuesOf added in v2.12.0

func ValuesOf(ss ...string) Values

func (Values) Append added in v2.12.0

func (vs Values) Append(s string, tag reflect.StructTag) Values

func (Values) Identifiers added in v2.12.0

func (vs Values) Identifiers() []string

func (Values) Shortened added in v2.12.0

func (vs Values) Shortened() []string

Jump to

Keyboard shortcuts

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