scaffold

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LiteCoreGoVersion = version.Version

Variables

This section is empty.

Functions

func ConfigYaml

func ConfigYaml(data *TemplateData) (string, error)

func Controller

func Controller(data *TemplateData) (string, error)

func Entity

func Entity(data *TemplateData) (string, error)

func GenerateMain

func GenerateMain(data *TemplateData) (string, error)

func Gitignore

func Gitignore(data *TemplateData) (string, error)

func GoMod

func GoMod(data *TemplateData) (string, error)

func Makefile

func Makefile(data *TemplateData) (string, error)

func Middleware

func Middleware(data *TemplateData) (string, error)

func Readme

func Readme(data *TemplateData) (string, error)

func Repository

func Repository(data *TemplateData) (string, error)

func Run

func Run(cfg *Config) error

func RunInteractive

func RunInteractive(cfg *Config) error

func ServerMain

func ServerMain(data *TemplateData) (string, error)

func Service

func Service(data *TemplateData) (string, error)

Types

type Config

type Config struct {
	ModulePath    string       // 模块路径,如 github.com/user/app
	ProjectName   string       // 项目名称
	OutputDir     string       // 输出目录
	TemplateType  TemplateType // 模板类型
	Interactive   bool         // 是否交互式
	LitecoreGoVer string       // LiteCore Go 版本
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Validate

func (cfg *Config) Validate() error

type TemplateData

type TemplateData struct {
	ModulePath  string
	ProjectName string
	LitecoreVer string
}

type TemplateType

type TemplateType string
const (
	TemplateTypeBasic    TemplateType = "basic"
	TemplateTypeStandard TemplateType = "standard"
	TemplateTypeFull     TemplateType = "full"
)

func (TemplateType) String

func (t TemplateType) String() string

func (TemplateType) Validate

func (t TemplateType) Validate() error

Jump to

Keyboard shortcuts

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