service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct

func New

func New() (s *Service)

New a DirService and return.

func (*Service) AggregateBranch

func (s *Service) AggregateBranch() (err error)

AggregateBranch ...

func (*Service) AggregateMR

func (s *Service) AggregateMR() (err error)

AggregateMR ...

func (*Service) AggregateProjectBranch

func (s *Service) AggregateProjectBranch(c context.Context, projectID int, master string) (err error)

AggregateProjectBranch ...

func (*Service) AggregateProjectMR

func (s *Service) AggregateProjectMR(c context.Context, projectID int) (err error)

AggregateProjectMR ...

func (*Service) AllBranchDiffWithMaster

func (s *Service) AllBranchDiffWithMaster(c context.Context, project int, master string) (branchDiff []*model.BranchDiffWithResponse, err error)

AllBranchDiffWithMaster ...

func (*Service) AllMergeBase

func (s *Service) AllMergeBase(c context.Context, project int, branches []string, master string) (mergeBase map[string]*gitlab.Commit, err error)

AllMergeBase ...

func (*Service) AllProjectBranchInfo

func (s *Service) AllProjectBranchInfo(c context.Context, projectID int) (branches map[string]*model.CommitTreeNode, err error)

AllProjectBranchInfo 获取所有分支信息

func (*Service) BuildCommitTree

func (s *Service) BuildCommitTree(c context.Context, project int) (tree []*model.CommitTreeNode, err error)

BuildCommitTree 获取到所有的Commits

func (*Service) Close

func (s *Service) Close()

Close close all dao.

func (*Service) CollectProject

func (s *Service) CollectProject(c context.Context) (err error)

CollectProject collect project information

func (*Service) CollectWachatUsers

func (s *Service) CollectWachatUsers(c context.Context) (err error)

CollectWachatUsers send required wechat visible users stored in memcache by email

func (*Service) ComputeCommitNum

func (s *Service) ComputeCommitNum(head *model.CommitTreeNode, base *gitlab.Commit, tree *[]*model.CommitTreeNode) (num int)

ComputeCommitNum ...

func (*Service) CreateWechat

func (s *Service) CreateWechat(c context.Context, req *model.CreateChatReq, username string) (resp *model.CreateChatResp, err error)

CreateWechat ...

func (*Service) EditFavorite

func (s *Service) EditFavorite(c context.Context, req *model.EditFavoriteReq, userName string) (resp *model.EmptyResp, err error)

EditFavorite edit user's favorites, star/unstar

func (*Service) FavoriteProjects

func (s *Service) FavoriteProjects(c context.Context, req *model.Pagination, userName string) (resp *model.FavoriteProjectsResp, err error)

FavoriteProjects list user's favorite projects

func (*Service) HandleNoteDBError

func (s *Service) HandleNoteDBError(c context.Context, noteDB *model.StatisticsNotes, errText string) (note *model.StatisticsNotes)

HandleNoteDBError ...

func (*Service) MRAddedInfoDB

func (s *Service) MRAddedInfoDB(c context.Context, projectID int, mr *model.StatisticsMrs) (err error)

MRAddedInfoDB ...

func (*Service) MRReviewerDB

func (s *Service) MRReviewerDB(c context.Context, projectID, mrIID int, projectName string, mr *model.StatisticsMrs) (err error)

MRReviewerDB 查询mr reviewer信息

func (*Service) MergeTasks

func (s *Service) MergeTasks(c context.Context, req *model.TasksReq) (resp *model.TasksResp, err error)

MergeTasks query all tasks for the project.

func (*Service) OptionSaga

func (s *Service) OptionSaga(c context.Context, projectID, sessionID string) (resp []*model.OptionSagaItem, err error)

OptionSaga ...

func (*Service) ParseRequestConfig

func (s *Service) ParseRequestConfig(projectInfo *model.ProjectInfo, configs []model.ConfigSagaItem) (requestConfig *model.RepoConfig, requestConfigStr string, err error)

ParseRequestConfig ...

func (*Service) ParseSvenConfig

func (s *Service) ParseSvenConfig(c context.Context, sessionID, projectUrl string) (fileContent, svenConfig string, err error)

ParseSvenConfig ...

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping check dao health.

func (*Service) PipelineAlert

func (s *Service) PipelineAlert(c context.Context, projectID, timeout, threshold, rate int, status gitlab.BuildStateValue) (err error)

PipelineAlert ...

func (*Service) PipelineRunningTime

func (s *Service) PipelineRunningTime(projectID, pipelineID int) (durationTime float64, err error)

PipelineRunningTime ...

func (*Service) PublicConfig

func (s *Service) PublicConfig(c context.Context, sessionID, user, configFileName, mark string, isSaga bool) (resp *model.CommonResp, err error)

PublicConfig ...

func (*Service) QueryAllConfigFile

func (s *Service) QueryAllConfigFile(c context.Context, sessionID string, isSaga bool) (resp *model.ConfigData, err error)

QueryAllConfigFile ...

func (*Service) QueryAllMergeRequestInfo

func (s *Service) QueryAllMergeRequestInfo(c context.Context, projID int) (info []*model.MrInfo, err error)

QueryAllMergeRequestInfo ...

func (*Service) QueryBranchDiffWith

func (s *Service) QueryBranchDiffWith(c context.Context, req *model.BranchDiffWithRequest) (resp []*model.BranchDiffWithResponse, err error)

QueryBranchDiffWith ...

func (*Service) QueryCommit

func (s *Service) QueryCommit(c context.Context, req *model.CommitRequest) (resp *model.CommitResp, err error)

QueryCommit query commit info according to department、 business and time.

func (*Service) QueryCommonProjects

func (s *Service) QueryCommonProjects(c context.Context) (result []string, err error)

QueryCommonProjects ...

func (*Service) QueryConfigFileContent

func (s *Service) QueryConfigFileContent(c context.Context, sessionID string) (content string, err error)

QueryConfigFileContent ...

func (*Service) QueryContactLogs

func (s *Service) QueryContactLogs(c context.Context, queryRequest *model.QueryContactLogRequest) (p *model.PaginateContactLog, err error)

QueryContactLogs query contact logs.

func (*Service) QueryContacts

func (s *Service) QueryContacts(c context.Context, queryRequest *model.Pagination) (p *model.PaginateContact, err error)

QueryContacts query machine logs.

func (*Service) QueryMergeRequestDiff

func (s *Service) QueryMergeRequestDiff(c context.Context, p, m int) (ChangeAdd, ChangeDel int, err error)

QueryMergeRequestDiff 查询获取到mr修改文件的总行数, 参数 p project_ID m MR_ID

func (*Service) QueryMergeRequestDiscussion

func (s *Service) QueryMergeRequestDiscussion(c context.Context, projectID, mrIID int) (total, solved int, err error)

QueryMergeRequestDiscussion 查询获取mr的discussion

func (*Service) QueryMergeRequestReview

func (s *Service) QueryMergeRequestReview(c context.Context, projectID, mrIID int) (reviewers []*model.MrReviewer, err error)

QueryMergeRequestReview 查询mr reviewer信息

func (*Service) QueryPipelinesFromDB

func (s *Service) QueryPipelinesFromDB(c context.Context, req *model.PipelineDataReq, since, until time.Time) (totalNum, statusNum int, pipelineTime *model.PipelineTime, err error)

QueryPipelinesFromDB ...

func (*Service) QueryProject

func (s *Service) QueryProject(c context.Context, object string, req *model.ProjectDataReq) (resp *model.ProjectDataResp, err error)

QueryProject query commit info according to project id.

func (*Service) QueryProjectBranchList

func (s *Service) QueryProjectBranchList(c context.Context, req *model.ProjectDataReq) (resp []*gitlab.Branch, err error)

QueryProjectBranchList query project commit info according to project id.

func (*Service) QueryProjectByTime

func (s *Service) QueryProjectByTime(projectID int, object string, queryType int) (resp []*model.DataWithTime, allNum int, err error)

QueryProjectByTime ...

func (*Service) QueryProjectByTimeNew

func (s *Service) QueryProjectByTimeNew(c context.Context, req *model.PipelineDataReq, queryType int) (resp []*model.PipelineDataAvg, allNum, allStatusNum int, avgDurationTime, avgPendingTime, avgRunningTime float64, err error)

QueryProjectByTimeNew ...

func (*Service) QueryProjectCommit

func (s *Service) QueryProjectCommit(c context.Context, req *model.ProjectDataReq) (resp *model.ProjectDataResp, err error)

QueryProjectCommit query project commit info according to project id.

func (*Service) QueryProjectInfo

func (s *Service) QueryProjectInfo(c context.Context, req *model.ProjectInfoRequest) (resp *model.ProjectInfoResp, err error)

QueryProjectInfo query project info.

func (*Service) QueryProjectJob

func (s *Service) QueryProjectJob(c context.Context, req *model.ProjectJobRequest) (resp *model.ProjectJobResp, err error)

QueryProjectJob ...

func (*Service) QueryProjectJobNew

func (s *Service) QueryProjectJobNew(c context.Context, req *model.ProjectJobRequest) (resp *model.ProjectJobResp, err error)

QueryProjectJobNew ...

func (*Service) QueryProjectMembers

func (s *Service) QueryProjectMembers(c context.Context, req *model.ProjectDataReq) (resp []*gitlab.ProjectMember, err error)

QueryProjectMembers ...

func (*Service) QueryProjectMr

func (s *Service) QueryProjectMr(c context.Context, req *model.ProjectDataReq) (resp *model.ProjectDataResp, err error)

QueryProjectMr query project commit info according to project id.

func (*Service) QueryProjectMrReport

func (s *Service) QueryProjectMrReport(c context.Context, req *model.ProjectMrReportReq) (resp *model.ProjectMrReportResp, err error)

QueryProjectMrReport query mr review

func (*Service) QueryProjectPipeline

func (s *Service) QueryProjectPipeline(projectID int, state string, since, until time.Time) (totalNum, stateNum int, err error)

QueryProjectPipeline query pipeline info according to project id.

func (*Service) QueryProjectPipelineNew

func (s *Service) QueryProjectPipelineNew(c context.Context, req *model.PipelineDataReq) (resp *model.PipelineDataAvgResp, err error)

QueryProjectPipelineNew ...

func (*Service) QueryProjectPipelines

func (s *Service) QueryProjectPipelines(c context.Context, req *model.PipelineDataReq, since, until time.Time) (totalNum, statusNum int, pipelineTime *model.PipelineTime, err error)

QueryProjectPipelines ...

func (*Service) QueryProjectRunners

func (s *Service) QueryProjectRunners(c context.Context, req *model.ProjectDataReq) (resp []*gitlab.Runner, err error)

QueryProjectRunners query project runners info according to project id

func (*Service) QueryProjectSagaConfig

func (s *Service) QueryProjectSagaConfig(c context.Context, sessionID string, projectID int) (sagaConfig *model.RepoConfig, err error)

QueryProjectSagaConfig ...

func (*Service) QueryProjectStatus

func (s *Service) QueryProjectStatus(c context.Context, req *model.ProjectDataReq) (resp []string)

QueryProjectStatus ...

func (*Service) QueryProjectTypes

func (s *Service) QueryProjectTypes(c context.Context, req *model.ProjectDataReq) (resp []*model.QueryTypeItem)

QueryProjectTypes ...

func (*Service) QueryTeam

func (s *Service) QueryTeam(c context.Context, object string, req *model.TeamDataRequest) (resp *model.TeamDataResp, err error)

QueryTeam ...

func (*Service) QueryTeamByTime

func (s *Service) QueryTeamByTime(object string, req *model.TeamDataRequest, queryType int, projectInfo []*model.ProjectInfo) (resp []*model.DataWithTime, allNum int, err error)

QueryTeamByTime query commit info per month of last year and per day of last month according to team.

func (*Service) QueryTeamCommit

func (s *Service) QueryTeamCommit(c context.Context, req *model.TeamDataRequest) (resp *model.TeamDataResp, err error)

QueryTeamCommit query team commit info according to department and business

func (*Service) QueryTeamMr

func (s *Service) QueryTeamMr(c context.Context, req *model.TeamDataRequest) (resp *model.TeamDataResp, err error)

QueryTeamMr query team commit info according to department and business

func (*Service) QueryTeamPipeline

func (s *Service) QueryTeamPipeline(c context.Context, req *model.TeamDataRequest) (resp *model.PipelineDataResp, err error)

QueryTeamPipeline query pipeline info according to team.

func (*Service) QueryTeamPipelineByTime

func (s *Service) QueryTeamPipelineByTime(projectInfo []*model.ProjectInfo, queryType int) (resp []*model.PipelineDataTime, allNum, succNum int, err error)

QueryTeamPipelineByTime ...

func (*Service) QueryUserIds

func (s *Service) QueryUserIds(userNames []string) (userIds []string, err error)

QueryUserIds ...

func (*Service) QueryWechatCreateLog

func (s *Service) QueryWechatCreateLog(c context.Context, req *model.Pagination, username string) (resp *model.CreateChatLogResp, err error)

QueryWechatCreateLog ...

func (*Service) ReleaseSagaConfig

func (s *Service) ReleaseSagaConfig(c context.Context, username, sessionID string, req *model.ConfigList) (resp *model.CommonResp, err error)

ReleaseSagaConfig ...

func (*Service) ReplaceConfig

func (s *Service) ReplaceConfig(c context.Context, username, sessionID string, projectInfo *model.ProjectInfo, req *model.ConfigList) (newConfig string, err error)

ReplaceConfig ...

func (*Service) SagaUserList

func (s *Service) SagaUserList(c context.Context) (resp []string, err error)

SagaUserList ...

func (*Service) SaveAggregateBranchDatabase

func (s *Service) SaveAggregateBranchDatabase(c context.Context, branchDB *model.AggregateBranches) (err error)

SaveAggregateBranchDatabase ...

func (*Service) SaveDatabaseAggMR

func (s *Service) SaveDatabaseAggMR(c context.Context, mrDB *model.AggregateMrReviewer) (err error)

SaveDatabaseAggMR ...

func (*Service) SaveDatabaseAwardEmoji

func (s *Service) SaveDatabaseAwardEmoji(c context.Context, awardEmojiDB *model.StatisticsMRAwardEmojis) (err error)

SaveDatabaseAwardEmoji ...

func (*Service) SaveDatabaseBranch

func (s *Service) SaveDatabaseBranch(c context.Context, branchDB *model.StatisticsBranches) (err error)

SaveDatabaseBranch ...

func (*Service) SaveDatabaseCommit

func (s *Service) SaveDatabaseCommit(commitDB *model.StatisticsCommits) (err error)

SaveDatabaseCommit ...

func (*Service) SaveDatabaseDiscussion

func (s *Service) SaveDatabaseDiscussion(c context.Context, discussionDB *model.StatisticsDiscussions) (err error)

SaveDatabaseDiscussion ...

func (*Service) SaveDatabaseIssue

func (s *Service) SaveDatabaseIssue(issueDB *model.StatisticsIssues) (err error)

SaveDatabaseIssue ...

func (*Service) SaveDatabaseMR

func (s *Service) SaveDatabaseMR(c context.Context, mrDB *model.StatisticsMrs) (err error)

SaveDatabaseMR ...

func (*Service) SaveDatabaseMember

func (s *Service) SaveDatabaseMember(c context.Context, memberDB *model.StatisticsMembers) (err error)

SaveDatabaseMember ...

func (*Service) SaveDatabaseNote

func (s *Service) SaveDatabaseNote(c context.Context, noteDB *model.StatisticsNotes) (err error)

SaveDatabaseNote ...

func (*Service) SaveDatabasePipeline

func (s *Service) SaveDatabasePipeline(pipelineDB *model.StatisticsPipeline) (err error)

SaveDatabasePipeline ...

func (*Service) SaveDatabaseRunner

func (s *Service) SaveDatabaseRunner(runnerDB *model.StatisticsRunners) (err error)

SaveDatabaseRunner ...

func (*Service) SaveDatabasejob

func (s *Service) SaveDatabasejob(jobDB *model.StatisticsJobs) (err error)

SaveDatabasejob ...

func (*Service) SendGroupWechat

func (s *Service) SendGroupWechat(c context.Context, req *model.SendChatReq) (resp *model.ChatResp, err error)

SendGroupWechat ...

func (*Service) SendWechat

func (s *Service) SendWechat(c context.Context, req *model.SendMessageReq) (resp *model.ChatResp, err error)

SendWechat ...

func (*Service) SyncAllIssues

func (s *Service) SyncAllIssues(projectID int) (totalPage, totalNum int, err error)

SyncAllIssues ...

func (*Service) SyncAllRunners

func (s *Service) SyncAllRunners(projectID int) (totalPage, totalNum int, err error)

SyncAllRunners ...

func (*Service) SyncBranch

func (s *Service) SyncBranch() (err error)

SyncBranch ...

func (*Service) SyncCommit

func (s *Service) SyncCommit() (err error)

SyncCommit ...

func (*Service) SyncContacts

func (s *Service) SyncContacts(c context.Context) (err error)

SyncContacts sync the wechat contacts 更新企业微信列表(用户信息和saga信息)

func (*Service) SyncData

func (s *Service) SyncData(c context.Context) (err error)

SyncData ...

func (*Service) SyncIssues

func (s *Service) SyncIssues() (err error)

SyncIssues ...

func (*Service) SyncJobs

func (s *Service) SyncJobs() (err error)

SyncJobs ...

func (*Service) SyncMR

func (s *Service) SyncMR() (err error)

SyncMR ...

func (*Service) SyncMRAwardEmoji

func (s *Service) SyncMRAwardEmoji() (err error)

SyncMRAwardEmoji ...

func (*Service) SyncMRDiscussion

func (s *Service) SyncMRDiscussion() (err error)

SyncMRDiscussion ...

func (*Service) SyncMRNote

func (s *Service) SyncMRNote() (err error)

SyncMRNote ...

func (*Service) SyncMember

func (s *Service) SyncMember() (err error)

SyncMember ...

func (*Service) SyncPipelines

func (s *Service) SyncPipelines() (err error)

SyncPipelines ...

func (*Service) SyncProjectAllPipelines

func (s *Service) SyncProjectAllPipelines(projectID int, projectName string) (result *model.SyncResult, err error)

SyncProjectAllPipelines ...

func (*Service) SyncProjectAwardEmoji

func (s *Service) SyncProjectAwardEmoji(c context.Context, projectID int) (totalPage, totalNum int, err error)

SyncProjectAwardEmoji ...

func (*Service) SyncProjectBranch

func (s *Service) SyncProjectBranch(c context.Context, projectID int) (result *model.SyncResult, err error)

SyncProjectBranch ...

func (*Service) SyncProjectCommit

func (s *Service) SyncProjectCommit(projectID int) (result *model.SyncResult, err error)

SyncProjectCommit ...

func (*Service) SyncProjectDiscussion

func (s *Service) SyncProjectDiscussion(c context.Context, projectID int) (totalPage, totalNum int, err error)

SyncProjectDiscussion ...

func (*Service) SyncProjectJobs

func (s *Service) SyncProjectJobs(projectID int) (result *model.SyncResult, err error)

SyncProjectJobs ...

func (*Service) SyncProjectJobsByTime

func (s *Service) SyncProjectJobsByTime(projectID int, projectName string, since, until time.Time) (result *model.SyncResult, err error)

SyncProjectJobsByTime ...

func (*Service) SyncProjectJobsNormal

func (s *Service) SyncProjectJobsNormal(projectID int, projectName string) (result *model.SyncResult, err error)

SyncProjectJobsNormal ...

func (*Service) SyncProjectMR

func (s *Service) SyncProjectMR(c context.Context, projectID int) (result *model.SyncResult, err error)

SyncProjectMR ...

func (*Service) SyncProjectMember

func (s *Service) SyncProjectMember(c context.Context, projectID int) (totalPage, totalNum int, err error)

SyncProjectMember ...

func (*Service) SyncProjectNotes

func (s *Service) SyncProjectNotes(c context.Context, projectID int) (totalPage, totalNum int, err error)

SyncProjectNotes ...

func (*Service) SyncProjectPipelines

func (s *Service) SyncProjectPipelines(projectID int) (result *model.SyncResult, err error)

SyncProjectPipelines ...

func (*Service) SyncProjectPipelinesByTime

func (s *Service) SyncProjectPipelinesByTime(projectID int, projectName string, since, until time.Time) (result *model.SyncResult, err error)

SyncProjectPipelinesByTime ...

func (*Service) SyncRunners

func (s *Service) SyncRunners() (err error)

SyncRunners ...

func (*Service) SyncWechatContacts

func (s *Service) SyncWechatContacts(c context.Context) (message string, err error)

SyncWechatContacts ...

func (*Service) UpdateConfig

func (s *Service) UpdateConfig(c context.Context, sessionID, user, configFileName, configContent, mark string, isSaga bool) (resp *model.CommonResp, err error)

UpdateConfig ...

func (*Service) UpdateWechat

func (s *Service) UpdateWechat(c context.Context, req *model.UpdateChatReq) (resp *model.ChatResp, err error)

UpdateWechat ...

func (*Service) UserInfo

func (s *Service) UserInfo(userName string) (userInfo *model.User)

UserInfo get username and email.

func (*Service) Wait

func (s *Service) Wait()

Wait wait all closed.

func (*Service) Wechat

func (s *Service) Wechat() *wechat.Wechat

Wechat ...

func (*Service) WechatFailData

func (s *Service) WechatFailData(dataType string, projectID int, result *model.SyncResult, error error) (err error)

WechatFailData ...

func (*Service) WechatParams

func (s *Service) WechatParams(c context.Context, chatid string) (resp *model.GetChatResp, err error)

WechatParams ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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