generate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package generate is to generate code, including model, cache, dao, handler, http, service, rpc, rpc-gw, rpc-cli code.

Index

Constants

View Source
const (
	// TplNameSponge name of the template
	TplNameSponge = "sponge"
)

Variables

View Source
var Replacers = map[string]replacer.Replacer{}

Replacers replacer name

Functions

func CacheCommand

func CacheCommand(parentName string) *cobra.Command

CacheCommand generate cache code

func ConfigCommand

func ConfigCommand() *cobra.Command

ConfigCommand convert yaml to struct command

func ConvertSwagJSONCommand

func ConvertSwagJSONCommand(parentName string) *cobra.Command

ConvertSwagJSONCommand convert 64-bit fields type string to integer

func DaoCommand

func DaoCommand(parentName string) *cobra.Command

DaoCommand generate dao code

func HTTPCommand

func HTTPCommand() *cobra.Command

HTTPCommand generate web service code

func HTTPPbCommand

func HTTPPbCommand() *cobra.Command

HTTPPbCommand generate web service code based on protobuf file

func HandlerCommand

func HandlerCommand() *cobra.Command

HandlerCommand generate handler code

func HandlerPbCommand

func HandlerPbCommand() *cobra.Command

HandlerPbCommand generate handler and protobuf code

func Init

func Init(name string, filepath string) error

Init initializing the template

func InitFS

func InitFS(name string, filepath string, fs embed.FS)

InitFS initializing th FS templates

func ModelCommand

func ModelCommand(parentName string) *cobra.Command

ModelCommand generate model code

func ProtoBufCommand

func ProtoBufCommand() *cobra.Command

ProtoBufCommand generate protobuf code

func RPCCommand

func RPCCommand() *cobra.Command

RPCCommand generate rpc service code

func RPCConnectionCommand

func RPCConnectionCommand() *cobra.Command

RPCConnectionCommand generate rpc connection code

func RPCGwPbCommand

func RPCGwPbCommand() *cobra.Command

RPCGwPbCommand generate rpc gateway service code base on protobuf file

func RPCPbCommand

func RPCPbCommand() *cobra.Command

RPCPbCommand generate rpc service code bash on protobuf file

func ServiceCommand

func ServiceCommand() *cobra.Command

ServiceCommand generate service code

Types

type Template

type Template struct {
	Name     string
	FS       embed.FS
	FilePath string
}

Template information

Jump to

Keyboard shortcuts

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