gen

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gen for generate golang code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comments

func Comments(w io.Writer, comments string)

Comments print comments with adds for every line "// ".

func Package

func Package(f io.Writer, pkgName string, comments ...string)

Package print package line with comments.

func TplDatabaseValueScan

func TplDatabaseValueScan(w io.Writer, structName string) error

Types

type Annotation

type Annotation struct {
	Name string
	Body string
}

Annotation conatiner with name and body annotation.

func ParseAnnotations

func ParseAnnotations(in string) []Annotation

ParseAnnotations return annotation from text.

Annotation format @<annotation_name(<annotation_body>).

type GeneratorRule

type GeneratorRule struct {
	AnnotaionName string
	Cfg           collections.GeneratorConfig
	CfgRaw        string
	G             collections.Generator
}

func NewGeneratorRule

func NewGeneratorRule(a Annotation) *GeneratorRule

func (*GeneratorRule) Gen

func (*GeneratorRule) IsValid

func (r *GeneratorRule) IsValid() bool

func (*GeneratorRule) Match

func (r *GeneratorRule) Match(node parse.Node) bool

func (r *GeneratorRule) Match(t token.Token, spec ast.Spec) bool {

func (*GeneratorRule) Name

func (r *GeneratorRule) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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