generator

package
v0.0.0-...-7175c3e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func INIT

func INIT(pBaseModel BaseModel)

INIT will scan each supplied Model/Domain object and generate the relevant Boilerplate code with which you can run TODO doco

Types

type KeyField

type KeyField struct {
	Name      string
	TypeName  string
	Index     int
	Tag       string
	Kind      string
	Primitive string
}

type ModelTemplate

type ModelTemplate struct {
	Version string
	Date    string
	Time    string
	Types   map[string]*TemplateType
}

Some rules 1: Primary keys if not one of the four base types will be an embedded type where only one param will be generated. 2: Compound keys which are expanded will be of the four base

base types and their primitives will be expanded into the

parameters.

type Tag

type Tag string

A StructTag is the tag string in a struct field.

By convention, tag strings are a concatenation of optionally space-separated key:"value" pairs. Each key is a non-empty string consisting of non-control characters other than space (U+0020 ' '), quote (U+0022 '"'), and colon (U+003A ':'). Each value is quoted using U+0022 '"' characters and Go string literal syntax.

func ExtractOpalTags

func ExtractOpalTags(pStructTag reflect.StructTag) Tag

func (Tag) Get

func (tag Tag) Get(key string) string

Get returns the value associated with key in the tag string. If there is no such key in the tag, Get returns the empty string. If the tag does not have the conventional format, the value returned by Get is unspecified.

type TemplateField

type TemplateField struct {
	Name      string
	Index     int
	Tag       string
	Kind      string
	Primitive string
}

type TemplateType

type TemplateType struct {
	Domain
	Version    string
	Date       string
	Time       string
	Receiver   string
	Model      string
	DAOName    string
	Path       string
	Package    string
	ImportName string
	Table      string
	Keys       []KeyField
	Columns    []TemplateField
}

Jump to

Keyboard shortcuts

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