v1

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 21 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(builder ModuleBuilder) *decoder

func NewDecoderBuilder

func NewDecoderBuilder(builder ModuleBuilder) *decoderBuilder

func NewDecoderTrait

func NewDecoderTrait(builder ModuleBuilder) *decoderTrait

func NewGenerator

func NewGenerator(getModelTrait FileModelTrait, readerMeta ReaderMeta, puller Puller) *generator

func NewGitPuller

func NewGitPuller() (g *gitPuller)

func NewModelFileReader

func NewModelFileReader() *file

func NewReaderMeta

func NewReaderMeta() *readerMeta

Types

type Constructor

type Constructor struct {
	GitAccessKey        string            `json:"git_access_key" yaml:"git_access_key"`
	Key                 string            `json:"key" yaml:"key"`
	ModelPath           string            `json:"model_path" yaml:"model_path"`
	ResultPath          string            `json:"result_path" yaml:"result_path"`
	ModuleName          string            `json:"module_name" yaml:"module_name"`
	ExecuteModels       []string          `json:"execute_models" yaml:"execute_models"`
	ModuleTraits        []ModuleTrait     `json:"module_traits" yaml:"module_traits"`
	Meta                map[string]string `json:"meta" yaml:"meta"`
	IncludeModuleTraits []string          `json:"include_module_traits"  yaml:"include_module_traits"`
	IncludeTraits       []string          `json:"include_traits" yaml:"include_traits"`
	Traits              []ModuleTrait     `json:"traits" yaml:"traits"`
}

func NewConstructor

func NewConstructor(p string) (b *Constructor, err error)

type Decoder

type Decoder interface {
	GetBuilder() ModuleBuilder
	Decode(code string) (encoded string)
}

type FileModelTrait

type FileModelTrait interface {
	GetModelTrait(file fs.FileInfo, c Constructor) (modelTrait *ModelTrait, err error)
}

type InfrastructureBuilder

type InfrastructureBuilder struct {
	Constructor
	ModelTrait []ModuleTrait `json:"model_trait" yaml:"model_trait"`
}

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 Constructor) *ModelTrait

type ModuleBuilder

type ModuleBuilder struct {
	Constructor
	ModelTrait
}

type ModuleTrait

type ModuleTrait struct {
	Name     string `json:"name" yaml:"name"`
	Dir      string `json:"dir" yaml:"dir"`
	FileName string `json:"file_name" yaml:"file_name"`
	Template string `json:"template" yaml:"template"`
	Active   bool   `json:"active" yaml:"active"`
	Remote   string `json:"remote" yaml:"remote"`
}

type Puller

type Puller interface {
	Pull(p string, targetDir string) error
}

type ReaderMeta

type ReaderMeta interface {
	GetMeta(file fs.FileInfo, c Constructor) (meta map[string]string, err error)
}

Directories

Path Synopsis
testing_env

Jump to

Keyboard shortcuts

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