gen

package
v0.0.0-...-dd25c24 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnotatedStructs

func AnotatedStructs(f *ast.File, anotation string) structs

func Generate

func Generate(from string, opts Option) error

func StructFuncs

func StructFuncs(f *ast.File) map[string]funcs

Types

type BelongsTo

type BelongsTo struct {
	Recv *structType
	// contains filtered or unexported fields
}

func (BelongsTo) BelongsTo

func (f BelongsTo) BelongsTo() bool

func (BelongsTo) ForeignKey

func (b BelongsTo) ForeignKey() string

func (BelongsTo) Func

func (b BelongsTo) Func() string

func (BelongsTo) FuncName

func (b BelongsTo) FuncName() string

func (BelongsTo) HasMany

func (f BelongsTo) HasMany() bool

func (BelongsTo) HasOne

func (f BelongsTo) HasOne() bool

func (BelongsTo) Model

func (b BelongsTo) Model() string

func (BelongsTo) PrimaryKey

func (b BelongsTo) PrimaryKey() string

func (BelongsTo) TableName

func (b BelongsTo) TableName() string

type HasMany

type HasMany struct {
	Recv *structType
	// contains filtered or unexported fields
}

func (HasMany) BelongsTo

func (f HasMany) BelongsTo() bool

func (HasMany) ForeignKey

func (h HasMany) ForeignKey() string

func (HasMany) ForeignKeyField

func (h HasMany) ForeignKeyField() string

func (HasMany) Func

func (h HasMany) Func() string

func (HasMany) FuncName

func (h HasMany) FuncName() string

func (HasMany) HasMany

func (f HasMany) HasMany() bool

func (HasMany) HasOne

func (f HasMany) HasOne() bool

func (HasMany) Model

func (h HasMany) Model() string

func (HasMany) TableName

func (h HasMany) TableName() string

type HasOne

type HasOne struct {
	Recv *structType
	// contains filtered or unexported fields
}

func (HasOne) BelongsTo

func (f HasOne) BelongsTo() bool

func (HasOne) ForeignKey

func (h HasOne) ForeignKey() string

func (HasOne) Func

func (h HasOne) Func() string

func (HasOne) FuncName

func (h HasOne) FuncName() string

func (HasOne) HasMany

func (f HasOne) HasMany() bool

func (HasOne) HasOne

func (f HasOne) HasOne() bool

func (HasOne) Model

func (h HasOne) Model() string

func (HasOne) TableName

func (h HasOne) TableName() string

type Option

type Option struct {
	Prefix string `short:"p" description:"Add prefix to generated file name." default:""`
	Suffix string `short:"s" description:"Add suffix to generated file name." default:"_gen"`
}

type Scope

type Scope struct {
	Recv *structType
	// contains filtered or unexported fields
}

func (Scope) BelongsTo

func (f Scope) BelongsTo() bool

func (Scope) Func

func (s Scope) Func() string

func (Scope) FuncName

func (s Scope) FuncName() string

func (Scope) HasMany

func (f Scope) HasMany() bool

func (Scope) HasOne

func (f Scope) HasOne() bool

type Template

type Template struct {
	Name string
	Text string
}

type Templates

type Templates []*Template

func (Templates) ToString

func (ts Templates) ToString() string

type Validation

type Validation struct {
	Recv *structType
	// contains filtered or unexported fields
}

func (Validation) BelongsTo

func (f Validation) BelongsTo() bool

func (Validation) ColumnName

func (v Validation) ColumnName() string

func (Validation) FieldName

func (v Validation) FieldName() string

func (Validation) FuncName

func (v Validation) FuncName() string

func (Validation) HasMany

func (f Validation) HasMany() bool

func (Validation) HasOne

func (f Validation) HasOne() bool

Jump to

Keyboard shortcuts

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