generator

package
v0.0.0-...-82560b4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Entity
	Stringer           string = "String"
	SetterPrefix              = "Set"
	Neww                      = "New"
	MustNew                   = "MustNew"
	Equal                     = "Equal"
	UnmarshalFromStore        = "UnmarshalFromStore"
	Apply                     = "Apply"

	// DomainCommandHandler
	Handle      = "Handle"
	Facts       = "Facts"
	FactsField  = "facts"
	Errors      = "Errors"
	ErrorsField = "errors"
	RecordOn    = "recordOn"
	Raise       = "raise"
)

Constants represent invariant contract requirements that would have been too cumbersome to expose as configuration They _could_ be configuration, there is just not much gain in it.

Variables

This section is empty.

Functions

func GenApplyStub

func GenApplyStub(g *Group, typ string) (ident string)

func GenEqual

func GenEqual(f *File, typ string, flds []EqualFld)

func GenFuncErrors

func GenFuncErrors(f *File, typ string) (ident string)

func GenFuncFacts

func GenFuncFacts(f *File, typ string) (ident string)

func GenFuncHandleStub

func GenFuncHandleStub(f *File, typ string, entity QualId) (ident string)

func GenFuncraise

func GenFuncraise(f *File, typ string) (ident string)

func GenFuncrecordOn

func GenFuncrecordOn(f *File, typ string, entity QualId) (ident string)

func GenGetters

func GenGetters(f *File, typ string, flds []QualField)

func GenMustNew

func GenMustNew(f *File, typ string, publicFlds []QualField)

func GenNew

func GenNew(f *File, typ string, publicFlds []QualField, validations []Validation, validatorMethod string)

func GenSetters

func GenSetters(f *File, typ string, flds []QualField)

func GenStringer

func GenStringer(f *File, typ string, flds []QualField)

func GenUnmarshalFromStore

func GenUnmarshalFromStore(f *File, typ string, publicFlds, privateFlds []QualField)

Types

type EqualFld

type EqualFld struct {
	Field       QualField
	IsDeepEqual bool
}

type QualField

type QualField struct {
	Id      string
	QualTyp *jen.Statement
}

type QualId

type QualId struct {
	Qual, Id string
}

type Validation

type Validation struct {
	Field  QualField
	ErrMsg string
}

Jump to

Keyboard shortcuts

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