vben

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// VarStringOutput describes the output.
	VarStringOutput string
	// VarStringApiFile describes the api file path
	VarStringApiFile string
	// VarStringFolderName describes the folder name to output dir
	VarStringFolderName string
	// VarStringApiPrefix describes the request URL's prefix
	VarStringApiPrefix string
	// VarStringModelName describes the model name
	VarStringModelName string
	// VarStringSubFolder describes the sub folder name
	VarStringSubFolder string
	// VarBoolOverwrite describes whether to overwrite the files, it will overwrite all generated files.
	VarBoolOverwrite bool
)

Functions

func ConvertGoTypeToTsType

func ConvertGoTypeToTsType(goType string) string

func ConvertTagToRules

func ConvertTagToRules(tagString string) ([]string, error)

ConvertTagToRules converts validator tag to rules.

func FindBeginEndOfLocaleField

func FindBeginEndOfLocaleField(data, target string) (int, int)

func GenCRUDLogic

func GenCRUDLogic(_ *cobra.Command, _ []string) error

GenCRUDLogic is used to generate CRUD file for simple admin backend UI

func GetRuleType

func GetRuleType(t string) string

GetRuleType returns the rule type from go type.

func GetRules

func GetRules(t spec.Member) string

GetRules returns the rules from tag.

Types

type GenContext

type GenContext struct {
	ApiDir        string
	ModelDir      string
	ViewDir       string
	Prefix        string
	ModelName     string
	LocaleDir     string
	FolderName    string
	SubFolderName string
	ApiSpec       *spec.ApiSpec
	UseUUID       bool
	HasStatus     bool
	HasState      bool
	Overwrite     bool
}

func (GenContext) Validate

func (g GenContext) Validate() error

Jump to

Keyboard shortcuts

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