v0

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp(path string) *app

func NewDecoder

func NewDecoder(blueprint *Blueprint) *decoder

func NewModelScanner

func NewModelScanner(c Config) *modelScanner

Types

type Base

type Base struct {
	ModuleName string `json:"module_name"`
	ResultPath string `json:"result_path"`
	ModelPath  string `json:"model_path"`
}

type BaseTrait

type BaseTrait struct {
	Base
	Trait
}

type Blueprint

type Blueprint struct {
	Base
	Jobs []Trait `json:"jobs"`
}

func (Blueprint) Generate

func (b Blueprint) Generate() error

type Config

type Config struct {
	Key           string        `json:"key"`
	ModelPath     string        `json:"model_path"`
	ResultPath    string        `json:"result_path"`
	ModuleName    string        `json:"module_name"`
	ExecuteModels []string      `json:"execute_models"`
	ModuleTraits  []ModuleTrait `json:"module_traits"`
}

func OpenConfig

func OpenConfig(p string) (b Config, err error)

type ModelField

type ModelField struct {
	Json  string                 `json:"json"`
	Name  string                 `json:"name"`
	Type  string                 `json:"type"`
	IsPtr bool                   `json:"is_ptr"`
	Meta  map[string]interface{} `json:"meta"`
}

type ModelTrait

type ModelTrait struct {
	ModelFields []ModelField `json:"model_fields"`
	Model       string       `json:"model"`
	ModelSnake  string       `json:"model_snake"`
	ModelCamel  string       `json:"model_camel"`
}

func NewModelTraitFromFile

func NewModelTraitFromFile(fl io.Reader, modelName string, config Config) *ModelTrait

type ModuleTrait

type ModuleTrait struct {
	Name     string                 `json:"name"`
	Dir      string                 `json:"dir"`
	FileName string                 `json:"file_name"`
	Template string                 `json:"template"`
	Meta     map[string]interface{} `json:"meta"`
}

type Trait

type Trait struct {
	Meta map[string]interface{} `json:"meta"`
	ModelTrait
	ModuleTrait
}

Jump to

Keyboard shortcuts

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