confgo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Cmc ...
	Cmc *cmc
	// ConfuSrv ...
	ConfuSrv *confu
	// CmcAppSrv ...
	CmcAppSrv *configApp
	// PublishSrv ...
	PublishSrv *publish
	// ResourceSrv ...
	ResourceSrv *resources
	// HistorySrv ...
	HistorySrv *history
	// Confgo ...
	Confgo *confgo
)
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 FindResource

func FindResource(list []db.CmcResource, call func(val db.CmcResource) bool) (resource db.CmcResource)

FindResource Replace when the associated resource is published, save an external template diff file

func FormatByKvs

func FormatByKvs(items []db.CmcConfig, format string, value string) (text, md5Str string, err error)

FormatByKvs ..

func GenConfig

func GenConfig(configID int, itemID int, value, key string) (text string, err error)

GenConfig ..

func GetConfig

func GetConfig(configID int, itemID int) (text string, err error)

GetConfig ..

func GetConfuContent

func GetConfuContent(aid int, fileName string) string

func Init

func Init()

Init ...

func JSONMarshal

func JSONMarshal(v interface{}, safeEncoding bool) string

JSONMarshal Auxiliary function

func ParseGoDepPkg

func ParseGoDepPkg(content []byte, aid int) error

parse packages dependencies ParseGoDepPkg parse content of Gopkg.lock

func ParseGoModPkg

func ParseGoModPkg(content []byte, aid int) error

ParseGoModPkg parse content of go.mod

func PublishSign

func PublishSign(text string, textMd5, format string) (signText, md5Str string, err error)

PublishSign ..

Types

type CmcTpl

type CmcTpl struct {
	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"`
	Key      string `json:"key"`
	TplId    int    `json:"tpl_id"`
	TplType  string `json:"tpl_type"`
	view.RespOneConfig
	Metadata map[string]string `json:"metadata"`
	// contains filtered or unexported fields
}

func InitCmcTpl

func InitCmcTpl(db *gorm.DB, value view.RespOneConfig) *CmcTpl

func ParseConfig

func ParseConfig(tx *gorm.DB, value view.RespOneConfig) (output []*CmcTpl, err error)

func (*CmcTpl) GetTpl

func (c *CmcTpl) GetTpl(id int) (tpl string, err error)

func (*CmcTpl) ParseTpl

func (c *CmcTpl) ParseTpl(tpl string) (err error)

type ConfuData

type ConfuData struct {
	ID         int
	Caid       int
	Aid        int
	Env        string
	FileName   string
	OriginToml string
}

Jump to

Keyboard shortcuts

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