templates

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BusinessTemplate

func BusinessTemplate(name string) string

func CmdExtensionTemplate

func CmdExtensionTemplate(name, extType, moduleName string) string

CmdExtensionTemplate generates the extension.go file for the provider directory

func CmdGinTemplate

func CmdGinTemplate(name, extType, moduleName string) string

CmdGinTemplate generates the gin.go file for the provider directory

func CmdMainTemplate

func CmdMainTemplate(name, extType, moduleName string) string

CmdMainTemplate generates the main.go file for the cmd directory

func CmdRestTemplate

func CmdRestTemplate(name, extType, moduleName string) string

CmdRestTemplate generates the rest.go file for the provider directory

func CmdServerTemplate

func CmdServerTemplate(name, extType, moduleName string) string

CmdServerTemplate generates the server.go file for the provider directory

func CoreTemplate

func CoreTemplate(name string) string

func DataTemplate

func DataTemplate(name, extType string) string

func DataTemplateWithEnt

func DataTemplateWithEnt(name, extType string) string

func DataTemplateWithGorm

func DataTemplateWithGorm(name, extType string) string

func DataTemplateWithMongo

func DataTemplateWithMongo(name, extType string) string

func ExtTestTemplate

func ExtTestTemplate(name, extType, moduleName string) string

ExtTestTemplate generates extension test template

func GeneraterTemplate

func GeneraterTemplate(name, extType, moduleName string) string

func HandlerTemplate

func HandlerTemplate(name, extType, moduleName string) string

func HandlerTestTemplate

func HandlerTestTemplate(name, extType, moduleName string) string

HandlerTestTemplate generates handler test template

func PluginTemplate

func PluginTemplate(name string) string

func RepositoryTemplate

func RepositoryTemplate(name, extType, moduleName string) string

func SchemaTemplate

func SchemaTemplate() string

func ServiceTemplate

func ServiceTemplate(name, extType, moduleName string) string

func ServiceTestTemplate

func ServiceTestTemplate(name, extType, moduleName string) string

ServiceTestTemplate generates service test template

func StandaloneConfigTemplate

func StandaloneConfigTemplate(name, moduleName string) string

StandaloneConfigTemplate generates the config.go file for standalone applications

func StandaloneGinTemplate

func StandaloneGinTemplate(name, moduleName string) string

StandaloneGinTemplate generates the gin.go file for standalone applications

func StandaloneHandlerTemplate

func StandaloneHandlerTemplate(name, moduleName string) string

StandaloneHandlerTemplate generates the handler.go file for standalone applications

func StandaloneHandlerTestTemplate

func StandaloneHandlerTestTemplate(name, moduleName string) string

StandaloneHandlerTestTemplate generates the handler_test.go file for standalone applications

func StandaloneMainTemplate

func StandaloneMainTemplate(name, moduleName string) string

StandaloneMainTemplate generates the main.go file for standalone applications

func StandaloneModelTemplate

func StandaloneModelTemplate(name, moduleName string) string

StandaloneModelTemplate generates the model.go file for standalone applications

func StandaloneRepositoryTemplate

func StandaloneRepositoryTemplate(name, moduleName string, useMongo, useEnt, useGorm bool) string

StandaloneRepositoryTemplate generates the repository.go file for standalone applications

func StandaloneRestTemplate

func StandaloneRestTemplate(name, moduleName string) string

StandaloneRestTemplate generates the rest.go file for standalone applications

func StandaloneServerTemplate

func StandaloneServerTemplate(name, moduleName string) string

StandaloneServerTemplate generates the server.go file for standalone applications

func StandaloneServiceTemplate

func StandaloneServiceTemplate(name, moduleName string) string

StandaloneServiceTemplate generates the service.go file for standalone applications

func StandaloneServiceTestTemplate

func StandaloneServiceTestTemplate(name, moduleName string) string

StandaloneServiceTestTemplate generates the service_test.go file for standalone applications

func StructsTemplate

func StructsTemplate() string

Types

type Data

type Data struct {
	Name        string // Extension name
	Type        string // Extension type (core/business/plugin/custom)
	CustomDir   string // Custom directory name, if type is custom
	ModuleName  string // Go module name
	UseMongo    bool   // Whether to use MongoDB
	UseEnt      bool   // Whether to use Ent ORM
	UseGorm     bool   // Whether to use GORM
	WithCmd     bool   // Whether to generate cmd directory with main.go
	WithTest    bool   // Whether to generate test files
	Standalone  bool   // Whether to generate as standalone app without extension structure
	Group       string // Optional group name
	ExtType     string // Extension type in belongs domain path (core/business/plugin/custom)
	PackagePath string // Full package path
}

Data represents template data structure

Jump to

Keyboard shortcuts

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