create

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// API_PULL_ROUTER name of the interface used to register the pull route in the template
	API_PULL_ROUTER = "__API__PULL__"
	// API_PUSH_ROUTER name of the interface used to register the push route in the template
	API_PUSH_ROUTER = "__API__PUSH__"
	// MODEL name of the struct used to create model
	MODEL = "__MODEL__"
)

Variables

This section is empty.

Functions

func CreateProject

func CreateProject(tplFile string)

CreateProject creates a project.

Types

type CtrlStruct

type CtrlStruct struct {
	Doc     string
	Name    string
	Methods []*Handler
}

CtrlStruct defined controller struct

type Handler

type Handler struct {
	IsCtrl bool
	Name   string
	Doc    string
	Param  string
	Result string
}

Handler defined router handler

type Model

type Model struct {
	Name             string
	SnakeName        string
	LowerFirstName   string
	LowerFirstLetter string
	StructDefinition string
	NameSql          string
	QuerySql         [2]string
	UpdateSql        string
	UpsertSqlSuffix  string
	// contains filtered or unexported fields
}

type Project

type Project struct {
	Name         string
	ImprotPrefix string
	Types        []*TypeStructGroup
	CtrlStructs  map[string]*CtrlStruct
	PullApis     []*Handler
	PushApis     []*Handler
	Models       map[string]*Model
	// contains filtered or unexported fields
}

Project project Information

func NewProject

func NewProject(src []byte) *Project

NewProject new project.

func (*Project) Generator

func (p *Project) Generator()

Generator generates code files.

func (*Project) Prepare

func (p *Project) Prepare()

Prepare prepares project.

type TypeStruct

type TypeStruct struct {
	Doc  string
	Name string
	Body string
	// contains filtered or unexported fields
}

TypeStruct defined struct in types directory

type TypeStructGroup

type TypeStructGroup struct {
	Doc     string
	Structs []*TypeStruct
}

TypeStructGroup a group of defined types

Directories

Path Synopsis
tpl

Jump to

Keyboard shortcuts

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