v1

package
v1.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Dart = "dart"
View Source
const GO = "go"
View Source
const Typescript = "typescript"

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor struct {
	GitAccessKey  string                       `json:"git_access_key" yaml:"git_access_key"`
	Key           string                       `json:"key" yaml:"key"`
	Lang          string                       `json:"lang" yaml:"lang"`
	ModelPath     string                       `json:"model_path" yaml:"model_path"`
	ModuleName    string                       `json:"module_name" yaml:"module_name"`
	Jobs          []Job                        `json:"jobs" yaml:"jobs"`
	Meta          map[string]string            `json:"meta" yaml:"meta"`
	IncludeJobs   []string                     `json:"include_jobs"  yaml:"include_jobs"`
	IncludeTraits []string                     `json:"include_traits" yaml:"include_traits"`
	Models        map[string]map[string]string `json:"models" yaml:"models"`
}

type Decoder

type Decoder interface {
	Decode(code string, mt *ModelTrait) (encoded string)
	DecodeBuilder(builder ModuleBuilder) (r ModuleBuilder)
	DecodeTrait(trait Job, mt *ModelTrait) (r Job)
}

type Generator added in v1.3.2

type Generator interface {
	Generate(constructor Constructor) error
}

type InfrastructureBuilder

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

type Job added in v1.3.2

type Job 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"`
	CMD           []string `json:"cmd" yaml:"CMD"`
	Tags          []string `json:"tags" yaml:"tags"`
	GenerateIn    string   `json:"generate_in" yaml:"generate_in"`
	SingleExecute bool     `json:"single_execute" yaml:"single_execute"`
}

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"`
	ModelPlural string       `json:"model_plural"`
	ModelHyp    string       `json:"model_hyp"`
	FileInfo    fs.FileInfo
	ModelMeta   map[string]string
}

func NewModelTraitFromFile

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

type ModuleBuilder

type ModuleBuilder struct {
	Constructor
	*ModelTrait
}

type ReaderConstructor added in v1.3.2

type ReaderConstructor interface {
	Read(p string) (b *Constructor, err error)
}

type ReaderMeta

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

type ReaderModel added in v1.3.2

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

Directories

Path Synopsis
service
generator_v2/test/app/docs
Code generated by swaggo/swag.
Code generated by swaggo/swag.
spam

Jump to

Keyboard shortcuts

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