confgo

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEP_POINT  = "."
	TPL_SYMBOL = "{{}}"
)

Variables

View Source
var (
	// Cmc ...
	Cmc *cmc
	// ConfuSrv ...
	ConfuSrv *confu
)
View Source
var (
	CmcIp       = "{{IP}}"
	CmcPort     = "{{PORT}}"
	CmcAddr     = "{{ADDR}}"
	CmcDsn      = "{{DSN}}"
	CmcUrl      = "{{URL}}"
	CmcUserName = "{{USERNAME}}"
	CmcPassword = "{{PASSWORD}}"
	CmcAll      = "{{ALL}}" // 全部解析

	CmcArr = []string{CmcIp, CmcPort, CmcUserName, CmcPassword, CmcAddr, CmcDsn, CmcUrl, CmcAll}
)

Functions

func GetAllTpl added in v0.3.0

func GetAllTpl(dbConn *gorm.DB) (resp []db.CmcTpl, err error)

func Init

func Init()

Init ...

func ParseTpl added in v0.3.0

func ParseTpl(tplList []db.CmcTpl) (allTplMap map[string]tplData, err error)

所有模板

Types

type CmcInfo added in v0.3.0

type CmcInfo struct {
	Key      string `json:"key"`
	Ip       string `json:"ip"`
	Port     string `json:"port"`
	UserName string `json:"user_name"`
	Password string `json:"password"`
	Scheme   string `json:"scheme"`
	DbName   string `json:"db_name"`
	Type     string `gorm:"not null;" json:"type"`
	view.RespOneConfig
}

type CmcParse added in v0.3.0

type CmcParse interface {
	ParseConfig() (output []*CmcInfo, err error)
}

type CmcToml added in v0.3.0

type CmcToml struct {
	Viper *viper.Viper
	view.RespOneConfig
	// contains filtered or unexported fields
}

func InitCmcToml added in v0.3.0

func InitCmcToml(db *gorm.DB, value view.RespOneConfig) *CmcToml

func (*CmcToml) ParseConfig added in v0.3.0

func (c *CmcToml) ParseConfig() (output []*CmcInfo, err error)

Jump to

Keyboard shortcuts

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