template

package
v0.0.0-...-c47cd45 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VAR_KEY_Model        = "Model"
	VAR_KEY_ModelName    = "ModelName"
	VAR_KEY_Table        = "TableName"
	VAR_KEY_TableName    = "TableName"
	VAR_KEY_TableComment = "TableComment"
	VAR_KEY_pkeyField    = "pkeyField"

	VAR_KEY_pkey     = "pkey"
	VAR_KEY_pkeyType = "pkeyType"
	VAR_KEY_Pkey     = "Pkey"
	VAR_KEY_PkeyType = "PkeyType"

	VAR_KEY_StrPkey    = "StrPkey"
	VAR_KEY_StrPkeyLen = "StrPkeyLen"
)
View Source
const (
	VAR_KEY_FileName    = "FileName"
	VAR_KEY_Description = "Description"
	VAR_KEY_Author      = "Author"
	VAR_KEY_DATETIME    = "DATETIME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DbTemplate

type DbTemplate struct {
	*dto.TableDto `json:"-"`

	StrTemplate
}

func NewDbTemplate

func NewDbTemplate() *DbTemplate

func (*DbTemplate) IniVars

func (this *DbTemplate) IniVars()

func (*DbTemplate) Parse

func (this *DbTemplate) Parse(f *dto.FileTemplate) string

func (*DbTemplate) ParseTemplateString

func (this *DbTemplate) ParseTemplateString(content string) string

type StrTemplate

type StrTemplate struct {
	IfTest  bool `json:"if_test"`
	FileKey int  `json:"file_key"`

	Author      string
	Datetime    string
	FileName    string
	Description string

	Vars map[string]interface{}
}

func NewStrTemplate

func NewStrTemplate() *StrTemplate

func (*StrTemplate) Get

func (this *StrTemplate) Get(key string) string

func (*StrTemplate) ParseTemplate

func (this *StrTemplate) ParseTemplate(bs string) string

func (*StrTemplate) Put

func (this *StrTemplate) Put(key, value string) *StrTemplate

Jump to

Keyboard shortcuts

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