codegen

package
v1.0.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagOptionAutoIncrement tagOption = "auto_increment"
	TagOptionBinary        tagOption = "binary"
	TagOptionPKAlias       tagOption = "pk"
	TagOptionPK            tagOption = "primary_key"
	TagOptionUnsigned      tagOption = "unsigned"
	TagOptionSize          tagOption = "size"
	TagOptionDataType      tagOption = "data_type"
	TagOptionUnique        tagOption = "unique"
)

Variables

This section is empty.

Functions

func Generate

func Generate(c *config.Config) error

func Init

func Init(cfg *config.Config) error

func IsImplemented

func IsImplemented(t types.Type, iv *types.Interface) bool

Types

type EmptyMatcher

type EmptyMatcher struct{}

func (*EmptyMatcher) Match

func (*EmptyMatcher) Match(v string) bool

type Expr

type Expr string

func (Expr) Format

func (e Expr) Format(pkg *Package, args ...any) string

type FieldTypeValue

type FieldTypeValue struct {
	FuncName string
	Type     string
	Valuer   string
	Value    string
}

type FileMatcher

type FileMatcher map[string]struct{}

func (FileMatcher) Match

func (f FileMatcher) Match(v string) bool

type Mapping

type Mapping struct {
	Encoder Expr
	Decoder Expr
}

func UnderlyingType

func UnderlyingType(t types.Type) (*Mapping, bool)

type Matcher

type Matcher interface {
	Match(v string) bool
}

type Package

type Package struct {
	// contains filtered or unexported fields
}

func NewPackage

func NewPackage(path, name string) *Package

func (*Package) Import

func (p *Package) Import(pkg *types.Package) (*types.Package, bool)

func (Package) Name

func (p Package) Name() string

func (Package) PkgPath

func (p Package) PkgPath() string

type RegexMatcher

type RegexMatcher struct {
	*regexp.Regexp
}

func (*RegexMatcher) Match

func (r *RegexMatcher) Match(v string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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