Documentation ¶
Index ¶
- Constants
- func CreateTopic(addrs []string, topic string, partitions int32, factor int16) (err error)
- func Diff(cluster, topic, group string) (records []*databus.Record, err error)
- func FetchMessage(c context.Context, cluster, topic, group, key string, start, end int64, ...) (res []*databus.Message, err error)
- func NewtonScore(maxMtime xtime.Time) (score float64)
- func WilsonScore(pos int, total int) (score float64)
- type ChatResult
- type Client
- func (c *Client) Close()
- func (c *Client) NewOffset(partition int32, offset int64) (err error)
- func (c *Client) NewTime(time int64) (err error)
- func (c *Client) OffsetMarked() (marked map[int32]int64, err error)
- func (c *Client) OffsetNew() (info map[int32]int64, err error)
- func (c *Client) OffsetNewTime(time int64) (info map[int32]int64, err error)
- func (c *Client) OffsetOld() (info map[int32]int64, err error)
- func (c *Client) Partitions() []int32
- func (c *Client) ResetOffset(partition int32, offset int64) (err error)
- func (c *Client) SeekBegin() (err error)
- func (c *Client) SeekEnd() (err error)
- func (c *Client) SetOffset(partition int32, offset int64) (err error)
- func (c *Client) Topics() []string
- type Common
- type CommonRes
- type Max
- type Prometheus
- type PrometheusRes
- type Ret
- type SQLLog
- type Service
- func (s *Service) ActiveWarning(c context.Context, text string) (err error)
- func (s *Service) AddMonitor(c context.Context) (err error)
- func (s *Service) AddPprofWarn(c context.Context, pws []*pprof.Warn) (err error)
- func (s *Service) AddUT(c context.Context, pkg *ut.PkgAnls, files []*ut.File, request *ut.UploadRes, ...) (err error)
- func (s *Service) AddUTApp(c context.Context, apps []*ut.App) (err error)
- func (s *Service) AddUTCommit(c context.Context, tx *gorm.DB, request *ut.UploadRes) (err error)
- func (s *Service) AddUTFiles(c context.Context, tx *gorm.DB, files []*ut.File) (err error)
- func (s *Service) AddUTMerge(c context.Context, tx *gorm.DB, request *ut.UploadRes) (err error)
- func (s *Service) AddUTPKG(c context.Context, tx *gorm.DB, pkg *ut.PkgAnls, request *ut.UploadRes, ...) (err error)
- func (s *Service) AppAdd(c *bm.Context, username string, AppTreeID int64, AppID string, Limit int64) (err error)
- func (s *Service) AppNameList(c context.Context) (apps []string)
- func (s *Service) Appids(c context.Context, username, cookie string) (appids []string, err error)
- func (s *Service) ApplyAdd(c *bm.Context, v *cml.Canal, username string) (err error)
- func (s *Service) ApplyDelete(c *bm.Context, v *cml.ScanReq, username string) (err error)
- func (s *Service) ApplyEdit(c *bm.Context, v *cml.EditReq, username string) (err error)
- func (s *Service) AppsCache(c context.Context) (err error)
- func (s *Service) BroadCast(c context.Context, appName []string, app string) (mts []*monitor.Monitor, err error)
- func (s *Service) BroadCastList(c context.Context) (ret *monitor.MoniRet, err error)
- func (s *Service) CalcCount(c context.Context, body []byte) (pkg *ut.PkgAnls, err error)
- func (s *Service) CalcCountFiles(c context.Context, res *ut.UploadRes, body []byte) (utFiles []*ut.File, err error)
- func (s *Service) ChatProxy(c context.Context) (ret *ChatResult, err error)
- func (s *Service) CheckMaster(c context.Context, v *cml.ConfigReq) (err error)
- func (s *Service) CheckUT(c context.Context, cid string) (t *ut.Tyrant, err error)
- func (s *Service) Close()
- func (s *Service) CommentOnMR(c context.Context, projID, mrID int, msg string) (err error)
- func (s *Service) CommitHistory(c context.Context, username string, times int64) (pkgs []*ut.PkgAnls, err error)
- func (s *Service) ConfigProxy(c context.Context, method string, uri string, params url.Values, cookie string, ...) (data json.RawMessage, err error)
- func (s *Service) DapperProxy(rw http.ResponseWriter, r *http.Request)
- func (s *Service) DashCurveGraph(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveResp, err error)
- func (s *Service) DashGraphDetail(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveDetailResp, err error)
- func (s *Service) DashGraphDetailSingle(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveDetailResp, err error)
- func (s *Service) DashPkgsTree(c context.Context, path string, username string) (pkgs []*ut.PkgAnls, err error)
- func (s *Service) DataBus(c context.Context) (mts []*monitor.Monitor, err error)
- func (s *Service) DataBusList(c context.Context) (ret *monitor.MoniRet, err error)
- func (s *Service) DatabusConsumerAddrs(c context.Context, group string) (addrs []string, err error)
- func (s *Service) DiscoveryID(c context.Context, username, cookie string) (appids []string, err error)
- func (s *Service) DiscoveryProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
- func (s *Service) DiscoveryTreeSync(c context.Context, username, cookie string)
- func (s *Service) GetAllErrors(c context.Context) (errs map[string]string, err error)
- func (s *Service) GetCodes(c context.Context, Interval1, Interval2 string) (data []*codes.Codes, err error)
- func (s *Service) GetDefaultPermission(c context.Context) (modules []string, rules []string)
- func (s *Service) GetInterfaces(c context.Context) (string, error)
- func (s *Service) GetScanInfo(c context.Context, v *cml.ScanReq, username string, cookie string) (confData *cml.Results, err error)
- func (s *Service) GetUser(c context.Context, username string) (usr *user.User, err error)
- func (s *Service) GitReport(c context.Context, projID int, mrID int, commitID string) (err error)
- func (s *Service) HTTPMonitor(c context.Context) ([]*monitor.Monitor, error)
- func (s *Service) KingSoft(c context.Context) (mts []*monitor.Monitor, err error)
- func (s *Service) LogAdd(c context.Context, lg *mlog.Log) (err error)
- func (s *Service) Members(c context.Context) (mt *monitor.Monitor, err error)
- func (s *Service) NeedInfoAdd(c context.Context, req *need.NAddReq, username string) (err error)
- func (s *Service) NeedInfoEdit(c context.Context, arg *need.NEditReq, username string) (err error)
- func (s *Service) NeedInfoList(c context.Context, arg *need.NListReq, username string) (res []*need.NInfo, count int64, err error)
- func (s *Service) NeedInfoVerify(c context.Context, arg *need.NVerifyReq) (ni *need.NInfo, err error)
- func (s *Service) NeedInfoVote(c context.Context, arg *need.Likereq, username string) (err error)
- func (s *Service) NeedVoteList(c context.Context, arg *need.Likereq) (res []*need.UserLikes, count int64, err error)
- func (s *Service) OnlineList(c context.Context) (ret *monitor.MoniRet, err error)
- func (s *Service) OpenProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
- func (s *Service) Opsmind(c context.Context, project, group, action, Owners string, ...) (result *databus.Res, err error)
- func (s *Service) OpsmindQuery(c context.Context, group, action string) (result *databus.ResQuery, err error)
- func (s *Service) OpsmindRemove(c context.Context, adjustid, action string) (result *databus.Res, err error)
- func (s *Service) ParseContent(c context.Context, body []byte) (content []byte, err error)
- func (s *Service) Permit(c context.Context, username string, rule string) (err error)
- func (s *Service) Ping(c context.Context) (err error)
- func (s *Service) PlatformProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
- func (s *Service) Pprof(url, uri, svgName, hostName string, time int64, sType int8) (err error)
- func (s *Service) PprofWarn(c context.Context, req *pprof.Params) (pws []*pprof.Warn, err error)
- func (s *Service) ProcessApplyList(c context.Context, v *cml.ListReq) (listdata *cml.Paper, err error)
- func (s *Service) ProcessCanalInfo(c context.Context, v *cml.ConfigReq, username string) (err error)
- func (s *Service) ProcessCanalList(c context.Context, v *cml.ListReq) (listdata *cml.Paper, err error)
- func (s *Service) ProcessConfigInfo(c context.Context, v *cml.ConfigReq, cookie string, username string) (err error)
- func (s *Service) Projects(c context.Context, username, cookie string) (projects []string, err error)
- func (s *Service) PrometheusList(c context.Context, app, method, mType string) (ret *monitor.MoniRet, err error)
- func (s *Service) PrometheusProxy(c context.Context, params url.Values, res interface{}) (err error)
- func (s *Service) QATrend(c context.Context, arg *ut.QATrendReq) (trend *ut.QATrendResp, err error)
- func (s *Service) RPCMonitor(c context.Context) ([]*monitor.Monitor, error)
- func (s *Service) RankTen(c context.Context, order string) (ranks []*ut.RankResp, err error)
- func (s *Service) RankWechatReport(c context.Context) (err error)
- func (s *Service) RanksCache(c context.Context) (err error)
- func (s *Service) ScanByAddrFromConfig(c context.Context, addr string, cookie string) (res *cml.Conf, err error)
- func (s *Service) SendLog(c context.Context, username string, uid int64, tp int, oid int64, ...) (err error)
- func (s *Service) SendWeChat(c context.Context, title, msg, treeID, users string) (err error)
- func (s *Service) SendWeMessage(c context.Context, title, task, result, sender string, receiver []string) (err error)
- func (s *Service) SendWechatMessage(c context.Context, addr, aType, result, sender, note string, receiver []string) (err error)
- func (s *Service) SetMerged(c context.Context, mrid int64) (err error)
- func (s *Service) SummaryWechatReport(c context.Context) (err error)
- func (s *Service) TableInfo(table string) (infos []*cml.Table, err error)
- func (s *Service) TenCent(c context.Context) (mts []*monitor.Monitor, err error)
- func (s *Service) Torch(c context.Context, url, uri, svgName, hostName string, time int64, sType int8) (err error)
- func (s *Service) TreeSync(c context.Context, username, cookie string)
- func (s *Service) Trees(c context.Context, username, cookie string) (nodem []*tree.Node, err error)
- func (s *Service) UTApps(c context.Context, v *ut.AppReq) (result []*ut.App, count int, err error)
- func (s *Service) UTGernalCommit(c context.Context, commits string) (cmInfos []*ut.CommitInfo, err error)
- func (s *Service) UpdateProcessTag(c context.Context, configID int, cookie string) (err error)
- func (s *Service) UpdateUTApp(c context.Context, pkg *ut.PkgAnls) (err error)
- func (s *Service) Upload(c context.Context, fileType string, expire int64, body []byte) (url string, err error)
- func (s *Service) UserRank(c context.Context, username string) (rank *ut.RankResp, err error)
- func (s *Service) UtDetailList(c context.Context, arg *ut.DetailReq) (utpkgs []*ut.PkgAnls, err error)
- func (s *Service) UtHistoryCommit(c context.Context, arg *ut.HistoryCommitReq) (utcmts []*ut.Commit, count int, err error)
- func (s *Service) UtList(c context.Context, arg *ut.MergeReq) (mrInfs []*ut.Merge, count int, err error)
- func (s *Service) WechatReport(c context.Context, mrid int64, cid, src, des string) (err error)
Constants ¶
const ( CPUPerformace = 1 // CPU性能图 CPUFrame = 2 // CPU火焰图 HeapPerformance = 3 // 内存性能图 HeapFrame = 4 // 内存火焰图 )
kind .
Variables ¶
This section is empty.
Functions ¶
func CreateTopic ¶
CreateTopic to kafka
func FetchMessage ¶
func FetchMessage(c context.Context, cluster, topic, group, key string, start, end int64, limit int) (res []*databus.Message, err error)
FetchMessage fetch topic message by timestamp or offset.
func NewtonScore ¶
NewtonScore . Newton's Law of Cooling 冷却因子经我们需求计算 a = 0.02 deltaDays<7 day -a*x^2+b >7 NewTonScore
func WilsonScore ¶
WilsonScore Wilson-score-interval
Types ¶
type ChatResult ¶
type ChatResult struct { Code int `json:"code"` Data struct { WebOnline int64 `json:"web_online"` } `json:"data"` }
ChatResult .
type Client ¶
Client kafka client
func (*Client) OffsetMarked ¶
OffsetMarked fetch marked offset
func (*Client) OffsetNewTime ¶
OffsetNewTime return newest offset for given topic
func (*Client) Partitions ¶
Partitions returns the list of parititons for the given topic, as registered with SetMetadata
func (*Client) ResetOffset ¶
ResetOffset commit offset of partition to kafka
type Common ¶
type Common struct { Metric struct { InstanceName string `json:"instance_name"` } `json:"metric"` Value []interface{} `json:"value"` }
Common .
type Prometheus ¶
type Prometheus struct { Metric struct { Method string `json:"method"` } `json:"metric"` Values [][]interface{} `json:"values"` }
Prometheus .
type PrometheusRes ¶
type PrometheusRes struct { RetCode int `json:"RetCode"` Data []*Prometheus `json:"data"` }
PrometheusRes http result
type Ret ¶
type Ret struct { ReqID string `json:"ReqId"` Action string `json:"Action"` RetCode int `json:"RetCode"` Data []string `json:"Data"` Response struct { Status int `json:"status"` } `json:"Response"` }
Ret .
type Service ¶
type Service struct { DB *gorm.DB DBDatabus *gorm.DB DBCanal *gorm.DB // contains filtered or unexported fields }
Service is a service.
func (*Service) ActiveWarning ¶
ActiveWarning active
func (*Service) AddMonitor ¶
AddMonitor get monitor data and insert
func (*Service) AddPprofWarn ¶
AddPprofWarn .
func (*Service) AddUT ¶
func (s *Service) AddUT(c context.Context, pkg *ut.PkgAnls, files []*ut.File, request *ut.UploadRes, dataURL, reportURL, HTMLURL string) (err error)
AddUT store ut data with a transaction
func (*Service) AddUTCommit ¶
AddUTCommit insert commit if not exist
func (*Service) AddUTFiles ¶
AddUTFiles add files in table ut_file
func (*Service) AddUTMerge ¶
AddUTMerge insert merge if not exist
func (*Service) AddUTPKG ¶
func (s *Service) AddUTPKG(c context.Context, tx *gorm.DB, pkg *ut.PkgAnls, request *ut.UploadRes, reportURL, HTMLURL, dataURL string) (err error)
AddUTPKG if not exists pkg.commit_id then insert,otherwise,update
func (*Service) AppAdd ¶
func (s *Service) AppAdd(c *bm.Context, username string, AppTreeID int64, AppID string, Limit int64) (err error)
AppAdd Appadd
func (*Service) AppNameList ¶
AppNameList return app list
func (*Service) ApplyDelete ¶
ApplyDelete canal delete
func (*Service) BroadCast ¶
func (s *Service) BroadCast(c context.Context, appName []string, app string) (mts []*monitor.Monitor, err error)
BroadCast return monitor data
func (*Service) BroadCastList ¶
BroadCastList return BroadCastList data
func (*Service) CalcCountFiles ¶
func (s *Service) CalcCountFiles(c context.Context, res *ut.UploadRes, body []byte) (utFiles []*ut.File, err error)
CalcCountFiles calculating lines and statements in files
func (*Service) ChatProxy ¶
func (s *Service) ChatProxy(c context.Context) (ret *ChatResult, err error)
ChatProxy chat proxy
func (*Service) CheckMaster ¶
CheckMaster canal check
func (*Service) CommentOnMR ¶
CommentOnMR create or modify comment on relavent merge request
func (*Service) CommitHistory ¶
func (s *Service) CommitHistory(c context.Context, username string, times int64) (pkgs []*ut.PkgAnls, err error)
CommitHistory .
func (*Service) ConfigProxy ¶
func (s *Service) ConfigProxy(c context.Context, method string, uri string, params url.Values, cookie string, args ...interface{}) (data json.RawMessage, err error)
ConfigProxy config proxy
func (*Service) DapperProxy ¶
func (s *Service) DapperProxy(rw http.ResponseWriter, r *http.Request)
DapperProxy dapper proxy.
func (*Service) DashCurveGraph ¶
func (s *Service) DashCurveGraph(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveResp, err error)
DashCurveGraph is a curve graph for leader to show the team members' code coverage
func (*Service) DashGraphDetail ¶
func (s *Service) DashGraphDetail(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveDetailResp, err error)
DashGraphDetail project graph detail for members.
func (*Service) DashGraphDetailSingle ¶
func (s *Service) DashGraphDetailSingle(c context.Context, username string, req *ut.PCurveReq) (res []*ut.PCurveDetailResp, err error)
DashGraphDetailSingle project graph detail for Single member.
func (*Service) DashPkgsTree ¶
func (s *Service) DashPkgsTree(c context.Context, path string, username string) (pkgs []*ut.PkgAnls, err error)
DashPkgsTree get all the lastest committed pkgs by username
func (*Service) DataBusList ¶
DataBusList return DataBusList data
func (*Service) DatabusConsumerAddrs ¶
DatabusConsumerAddrs databus consumer addrs.
func (*Service) DiscoveryID ¶
func (s *Service) DiscoveryID(c context.Context, username, cookie string) (appids []string, err error)
DiscoveryID get appid by username.
func (*Service) DiscoveryProxy ¶
func (s *Service) DiscoveryProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
DiscoveryProxy discovery proxy.
func (*Service) DiscoveryTreeSync ¶
DiscoveryTreeSync sync tree cache by username discoverykey.
func (*Service) GetAllErrors ¶
GetAllErrors 调用x/internal/canal/errors 查询错误信息
func (*Service) GetCodes ¶
func (s *Service) GetCodes(c context.Context, Interval1, Interval2 string) (data []*codes.Codes, err error)
GetCodes ...
func (*Service) GetDefaultPermission ¶
GetDefaultPermission get the modules and rules which have default permission
func (*Service) GetInterfaces ¶
GetInterfaces .
func (*Service) GetScanInfo ¶
func (s *Service) GetScanInfo(c context.Context, v *cml.ScanReq, username string, cookie string) (confData *cml.Results, err error)
GetScanInfo is
func (*Service) GetUser ¶
GetUser get user info by username if it exists, otherwise create the user info
func (*Service) HTTPMonitor ¶
HTTPMonitor get http monitor data
func (*Service) NeedInfoAdd ¶
NeedInfoAdd is
func (*Service) NeedInfoEdit ¶
NeedInfoEdit is
func (*Service) NeedInfoList ¶
func (s *Service) NeedInfoList(c context.Context, arg *need.NListReq, username string) (res []*need.NInfo, count int64, err error)
NeedInfoList is
func (*Service) NeedInfoVerify ¶
func (s *Service) NeedInfoVerify(c context.Context, arg *need.NVerifyReq) (ni *need.NInfo, err error)
NeedInfoVerify is
func (*Service) NeedInfoVote ¶
NeedInfoVote is
func (*Service) NeedVoteList ¶
func (s *Service) NeedVoteList(c context.Context, arg *need.Likereq) (res []*need.UserLikes, count int64, err error)
NeedVoteList is show votelist
func (*Service) OnlineList ¶
OnlineList return online data
func (*Service) OpenProxy ¶
func (s *Service) OpenProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
OpenProxy proxy.
func (*Service) Opsmind ¶
func (s *Service) Opsmind(c context.Context, project, group, action, Owners string, percentage, fortime int64, silence bool) (result *databus.Res, err error)
Opsmind ...
func (*Service) OpsmindQuery ¶
func (s *Service) OpsmindQuery(c context.Context, group, action string) (result *databus.ResQuery, err error)
OpsmindQuery ...
func (*Service) OpsmindRemove ¶
func (s *Service) OpsmindRemove(c context.Context, adjustid, action string) (result *databus.Res, err error)
OpsmindRemove ...
func (*Service) ParseContent ¶
ParseContent parse go test output to go convey result json. If result not contains "=== RUN", that means execute ut err.
func (*Service) PlatformProxy ¶
func (s *Service) PlatformProxy(c context.Context, method, loc string, params url.Values) (data interface{}, err error)
PlatformProxy proxy.
func (*Service) ProcessApplyList ¶
func (s *Service) ProcessApplyList(c context.Context, v *cml.ListReq) (listdata *cml.Paper, err error)
ProcessApplyList get apply list
func (*Service) ProcessCanalInfo ¶
func (s *Service) ProcessCanalInfo(c context.Context, v *cml.ConfigReq, username string) (err error)
ProcessCanalInfo is
func (*Service) ProcessCanalList ¶
func (s *Service) ProcessCanalList(c context.Context, v *cml.ListReq) (listdata *cml.Paper, err error)
ProcessCanalList get canal list
func (*Service) ProcessConfigInfo ¶
func (s *Service) ProcessConfigInfo(c context.Context, v *cml.ConfigReq, cookie string, username string) (err error)
ProcessConfigInfo process info to config center
func (*Service) Projects ¶
func (s *Service) Projects(c context.Context, username, cookie string) (projects []string, err error)
Projects get projects by username.
func (*Service) PrometheusList ¶
func (s *Service) PrometheusList(c context.Context, app, method, mType string) (ret *monitor.MoniRet, err error)
PrometheusList return PrometheusList data
func (*Service) PrometheusProxy ¶
func (s *Service) PrometheusProxy(c context.Context, params url.Values, res interface{}) (err error)
PrometheusProxy Get Prometheus Data
func (*Service) QATrend ¶
func (s *Service) QATrend(c context.Context, arg *ut.QATrendReq) (trend *ut.QATrendResp, err error)
QATrend give single user's coverage ,passrate and score data
func (*Service) RPCMonitor ¶
RPCMonitor get rpc monitor data
func (*Service) RankWechatReport ¶
RankWechatReport send rank to wechat group 19:00 everyday
func (*Service) RanksCache ¶
RanksCache flush cache for ranks.
func (*Service) ScanByAddrFromConfig ¶
func (s *Service) ScanByAddrFromConfig(c context.Context, addr string, cookie string) (res *cml.Conf, err error)
ScanByAddrFromConfig 根据addr查询配置信息
func (*Service) SendLog ¶
func (s *Service) SendLog(c context.Context, username string, uid int64, tp int, oid int64, action string, context interface{}) (err error)
SendLog log
func (*Service) SendWeChat ¶
SendWeChat send message to WeChat users: zhangsan,lisi,wangwu
func (*Service) SendWeMessage ¶
func (s *Service) SendWeMessage(c context.Context, title, task, result, sender string, receiver []string) (err error)
SendWeMessage send wechat message
func (*Service) SendWechatMessage ¶
func (s *Service) SendWechatMessage(c context.Context, addr, aType, result, sender, note string, receiver []string) (err error)
SendWechatMessage send wechat message
func (*Service) SummaryWechatReport ¶
SummaryWechatReport send depts' summary to ut wechat group every Friday(19:00)
func (*Service) Torch ¶
func (s *Service) Torch(c context.Context, url, uri, svgName, hostName string, time int64, sType int8) (err error)
Torch ...
func (*Service) UTGernalCommit ¶
func (s *Service) UTGernalCommit(c context.Context, commits string) (cmInfos []*ut.CommitInfo, err error)
UTGernalCommit get singe or all users' general commit infos
func (*Service) UpdateProcessTag ¶
UpdateProcessTag canal审核通过之后,调用/x/admin/config/canal/tag/update,同步到配置中心发版
func (*Service) UpdateUTApp ¶
UpdateUTApp update has_ut=1
func (*Service) Upload ¶
func (s *Service) Upload(c context.Context, fileType string, expire int64, body []byte) (url string, err error)
Upload upload file to bfs with no filename
func (*Service) UtDetailList ¶
func (s *Service) UtDetailList(c context.Context, arg *ut.DetailReq) (utpkgs []*ut.PkgAnls, err error)
UtDetailList get ut pkganls by commit_id&pkg
func (*Service) UtHistoryCommit ¶
func (s *Service) UtHistoryCommit(c context.Context, arg *ut.HistoryCommitReq) (utcmts []*ut.Commit, count int, err error)
UtHistoryCommit get commits history list by merge_id