Categorygithub.com/ainiaa/catutil/v2
package
2.0.0
Repository: https://github.com/ainiaa/catutil.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

catutil

catutil

支持 gorm、mongodb、http 的 cat 监控

golang cat client: github.com/cat-go/cat

PS 使用之前需要先初始化 cat

type CatConf struct {
	Flag       bool   `json:"flag"`
	AppId      string `json:"app_id"`
	Port       int    `json:"port"`
	HttpPort   int    `json:"http_port"`
	ServerAddr string `json:"server_addr"`
	IsDebug    bool   `json:"is_debug"`
}

func initCat(c *CatConf) {
	if c.Flag {
		if c.Cat.IsDebug {
			cat.DebugOn()
		}
		cat.Init(&cat.Options{
			AppId:      c.AppId,
			Port:       c.Port,
			HttpPort:   c.HttpPort,
			ServerAddr: c.ServerAddr,
		})
	}
}