generator

package
v0.0.0-...-2bdc998 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(list *Skeleton) error

Generate copies all files from the auth package and exec it as a text template before writing it at the destination

func InsertSecret

func InsertSecret(path, pkg string) error

InsertSecret creates a secret.go with information that shouldn't change after re-generating

func Run

func Run() error

Run the parser and generator

Types

type Config

type Config struct {
	Schema  map[string]interface{}
	Dest    string
	API     string
	Package string

	Database string
	File     string
	Debug    bool

	Logging bool
	Fmt     bool
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates and load a new config

func (*Config) Find

func (c *Config) Find() (string, bool)

Find the config file in the current folder

func (*Config) Load

func (c *Config) Load() error

Load reads the config file if found then inserts it into the config

type Field

type Field struct {
	Name string
	Type string
	Tags string
}

type Information

type Information struct {
	Activation bool
	Package    string
	DeadCode   bool

	Database           string
	Primes             []uint64
	SecretPackage      string
	DestinationPackage string
	Logging            bool
	Debug              bool

	Fields []*Field
}

Information that will be used in go templates

type Skeleton

type Skeleton struct {
	Fields   map[string]*Field
	Embedded *Skeleton
}

func Parse

func Parse(filePath string, data []byte) (*Skeleton, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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