generator

package
v0.0.0-...-4b3a70a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2014 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFiles

func GenerateFiles(inputPath string, outputPath string) error

func TempFileWithPostfix

func TempFileWithPostfix(dir, prefix string, postfix string) (f *os.File, err error)

TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the resulting *os.File. If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed.

Types

type InceptionMain

type InceptionMain struct {
	TempMainPath string
	// contains filtered or unexported fields
}

func NewInceptionMain

func NewInceptionMain(inputPath string, outputPath string) *InceptionMain

func (*InceptionMain) Generate

func (im *InceptionMain) Generate(packageName string, si []*StructInfo) error

func (*InceptionMain) Run

func (im *InceptionMain) Run() error

type StructField

type StructField struct {
	Name        string
	JsonName    string
	OmitEmpty   bool
	ForceString bool
}

type StructInfo

type StructInfo struct {
	Name   string
	Fields []StructField
}

func ExtractStructs

func ExtractStructs(inputPath string) (string, []*StructInfo, error)

func NewStructInfo

func NewStructInfo(name string) *StructInfo

func (*StructInfo) AddField

func (si *StructInfo) AddField(field *ast.Field) error

Jump to

Keyboard shortcuts

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