Documentation
¶
Index ¶
- type Dao
- func (d *Dao) AccessToken(c context.Context, key string) (token string, err error)
- func (d *Dao) AddMRIID(c context.Context, mrIID int, expire int) (err error)
- func (d *Dao) Close()
- func (d *Dao) ContactInfos() (contactInfos []*model.ContactInfo, err error)
- func (d *Dao) CreateContact(contact *model.ContactInfo) (err error)
- func (d *Dao) DelContact(contact *model.ContactInfo) (err error)
- func (d *Dao) DeleteMRIID(c context.Context, mrIID int) (err error)
- func (d *Dao) DeleteMergeInfo(c context.Context, projID int, branch string) (err error)
- func (d *Dao) DeleteMergeTask(c context.Context, taskType int, taskInfo *model.TaskInfo) (err error)
- func (d *Dao) DeletePathAuthH(c context.Context, projID int, branch string, path string) (err error)
- func (d *Dao) DeletePathAuthR(c context.Context, projID int, branch string, path string) (err error)
- func (d *Dao) DeleteReportStatus(c context.Context, projID int, mrIID int) (err error)
- func (d *Dao) DeleteRequireVisibleUsers(c context.Context) (err error)
- func (d *Dao) ExistMRIID(c context.Context, mrIID int) (ok bool, err error)
- func (d *Dao) MRRecordCache(c context.Context, mrID int) (record *model.MRRecord, err error)
- func (d *Dao) MergeInfo(c context.Context, projID int, branch string) (ok bool, mergeInfo *model.MergeInfo, err error)
- func (d *Dao) MergeTasks(c context.Context, taskType int) (count int, taskInfos []*model.TaskInfo, err error)
- func (d *Dao) PathAuthH(ctx context.Context, projID int, branch string, path string) (owners []string, reviewers []string, err error)
- func (d *Dao) PathAuthR(c context.Context, projID int, branch string, path string) (authUsers *model.AuthUsers, err error)
- func (d *Dao) PathOwner(c context.Context, projID int, branch string, path string) (owners []string, err error)
- func (d *Dao) PathReviewer(c context.Context, projID int, branch string, path string) (reviewers []string, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PostJSON(c context.Context, uri, ip string, params url.Values, res interface{}, ...) (err error)
- func (d *Dao) PushMergeTask(c context.Context, taskType int, taskInfo *model.TaskInfo) (err error)
- func (d *Dao) QueryUserByID(userID string) (contactInfo *model.ContactInfo, err error)
- func (d *Dao) QueryUserByUserName(userName string) (contactInfo *model.ContactInfo, err error)
- func (d *Dao) RepoFiles(c context.Context, Host string, token string, repo *model.RepoInfo) (files []string, err error)
- func (d *Dao) ReportStatus(c context.Context, projID int, mrIID int) (result bool, err error)
- func (d *Dao) RequireVisibleUsers(c context.Context, userMap *map[string]model.RequireVisibleUser) (err error)
- func (d *Dao) SetAccessToken(c context.Context, key string, token string, expire int32) (err error)
- func (d *Dao) SetMRRecordCache(c context.Context, record *model.MRRecord) (err error)
- func (d *Dao) SetMergeInfo(c context.Context, projID int, branch string, mergeInfo *model.MergeInfo) (err error)
- func (d *Dao) SetPathAuthH(c context.Context, projID int, branch string, path string, owners []string, ...) (err error)
- func (d *Dao) SetPathAuthR(c context.Context, projID int, branch string, path string, ...) (err error)
- func (d *Dao) SetPathOwner(c context.Context, projID int, branch string, path string, owners []string) (err error)
- func (d *Dao) SetPathReviewer(c context.Context, projID int, branch string, path string, reviewers []string) (err error)
- func (d *Dao) SetReportStatus(c context.Context, projID int, mrIID int, result bool) (err error)
- func (d *Dao) SetRequireVisibleUsers(c context.Context, contactInfo *model.ContactInfo) (err error)
- func (d *Dao) TryLock(c context.Context, key string, value string, timeout int) (ok bool, err error)
- func (d *Dao) UnLock(c context.Context, key string) (err error)
- func (d *Dao) UptContact(contact *model.ContactInfo) (err error)
- func (d *Dao) UserIds(userNames []string) (userIds string, err error)
- func (d *Dao) WechatAccessToken(c context.Context, secret string) (token string, expire int32, err error)
- func (d *Dao) WechatContacts(c context.Context, accessToken string) (contacts []*model.ContactInfo, err error)
- func (d *Dao) WechatPushMsg(c context.Context, token string, txtMsg *model.TxtNotification) (invalidUser string, err error)
- func (d *Dao) WechatSagaVisible(c context.Context, accessToken string, agentID int) (users []*model.UserInfo, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao def
func (*Dao) AccessToken ¶
AccessToken get access token from mc
func (*Dao) ContactInfos ¶
func (d *Dao) ContactInfos() (contactInfos []*model.ContactInfo, err error)
ContactInfos query all the records in contact_infos
func (*Dao) CreateContact ¶
func (d *Dao) CreateContact(contact *model.ContactInfo) (err error)
CreateContact create contact info record
func (*Dao) DelContact ¶
func (d *Dao) DelContact(contact *model.ContactInfo) (err error)
DelContact delete the contact info with the specified UserID
func (*Dao) DeleteMRIID ¶
DeleteMRIID ...
func (*Dao) DeleteMergeInfo ¶
DeleteMergeInfo ...
func (*Dao) DeleteMergeTask ¶
func (d *Dao) DeleteMergeTask(c context.Context, taskType int, taskInfo *model.TaskInfo) (err error)
DeleteMergeTask ...
func (*Dao) DeletePathAuthH ¶
func (d *Dao) DeletePathAuthH(c context.Context, projID int, branch string, path string) (err error)
DeletePathAuthH ...
func (*Dao) DeletePathAuthR ¶
func (d *Dao) DeletePathAuthR(c context.Context, projID int, branch string, path string) (err error)
DeletePathAuthR ...
func (*Dao) DeleteReportStatus ¶
DeleteReportStatus ...
func (*Dao) DeleteRequireVisibleUsers ¶
DeleteRequireVisibleUsers delete the wechat require visible key in memcache
func (*Dao) ExistMRIID ¶
ExistMRIID ...
func (*Dao) MRRecordCache ¶
MRRecordCache get MRRecord from mc
func (*Dao) MergeInfo ¶
func (d *Dao) MergeInfo(c context.Context, projID int, branch string) (ok bool, mergeInfo *model.MergeInfo, err error)
MergeInfo ...
func (*Dao) MergeTasks ¶
func (d *Dao) MergeTasks(c context.Context, taskType int) (count int, taskInfos []*model.TaskInfo, err error)
MergeTasks ...
func (*Dao) PathAuthH ¶
func (d *Dao) PathAuthH(ctx context.Context, projID int, branch string, path string) (owners []string, reviewers []string, err error)
PathAuthH ...
func (*Dao) PathAuthR ¶
func (d *Dao) PathAuthR(c context.Context, projID int, branch string, path string) (authUsers *model.AuthUsers, err error)
PathAuthR ...
func (*Dao) PathOwner ¶
func (d *Dao) PathOwner(c context.Context, projID int, branch string, path string) (owners []string, err error)
PathOwner ...
func (*Dao) PathReviewer ¶
func (d *Dao) PathReviewer(c context.Context, projID int, branch string, path string) (reviewers []string, err error)
PathReviewer ...
func (*Dao) PostJSON ¶
func (d *Dao) PostJSON(c context.Context, uri, ip string, params url.Values, res interface{}, v interface{}) (err error)
PostJSON post http request with json params.
func (*Dao) PushMergeTask ¶
PushMergeTask ...
func (*Dao) QueryUserByID ¶
func (d *Dao) QueryUserByID(userID string) (contactInfo *model.ContactInfo, err error)
QueryUserByID query user by user ID
func (*Dao) QueryUserByUserName ¶
func (d *Dao) QueryUserByUserName(userName string) (contactInfo *model.ContactInfo, err error)
QueryUserByUserName query user by user name
func (*Dao) RepoFiles ¶
func (d *Dao) RepoFiles(c context.Context, Host string, token string, repo *model.RepoInfo) (files []string, err error)
RepoFiles ...TODO 该方法放在gitlab里比较好
func (*Dao) ReportStatus ¶
ReportStatus ...
func (*Dao) RequireVisibleUsers ¶
func (d *Dao) RequireVisibleUsers(c context.Context, userMap *map[string]model.RequireVisibleUser) (err error)
RequireVisibleUsers get wechat require visible users from memcache
func (*Dao) SetAccessToken ¶
SetAccessToken set the access token to mc
func (*Dao) SetMRRecordCache ¶
SetMRRecordCache set MRRecord to mc
func (*Dao) SetMergeInfo ¶
func (d *Dao) SetMergeInfo(c context.Context, projID int, branch string, mergeInfo *model.MergeInfo) (err error)
SetMergeInfo ...
func (*Dao) SetPathAuthH ¶
func (d *Dao) SetPathAuthH(c context.Context, projID int, branch string, path string, owners []string, reviewers []string) (err error)
SetPathAuthH ...
func (*Dao) SetPathAuthR ¶
func (d *Dao) SetPathAuthR(c context.Context, projID int, branch string, path string, authUsers *model.AuthUsers) (err error)
SetPathAuthR ...
func (*Dao) SetPathOwner ¶
func (d *Dao) SetPathOwner(c context.Context, projID int, branch string, path string, owners []string) (err error)
SetPathOwner ...
func (*Dao) SetPathReviewer ¶
func (d *Dao) SetPathReviewer(c context.Context, projID int, branch string, path string, reviewers []string) (err error)
SetPathReviewer ...
func (*Dao) SetReportStatus ¶
SetReportStatus ...
func (*Dao) SetRequireVisibleUsers ¶
SetRequireVisibleUsers set wechat require visible users to memcache
func (*Dao) TryLock ¶
func (d *Dao) TryLock(c context.Context, key string, value string, timeout int) (ok bool, err error)
TryLock ...
func (*Dao) UptContact ¶
func (d *Dao) UptContact(contact *model.ContactInfo) (err error)
UptContact update the contact information
func (*Dao) WechatAccessToken ¶
func (d *Dao) WechatAccessToken(c context.Context, secret string) (token string, expire int32, err error)
WechatAccessToken query access token with the specified secret
func (*Dao) WechatContacts ¶
func (d *Dao) WechatContacts(c context.Context, accessToken string) (contacts []*model.ContactInfo, err error)
WechatContacts query all the contacts
func (*Dao) WechatPushMsg ¶
func (d *Dao) WechatPushMsg(c context.Context, token string, txtMsg *model.TxtNotification) (invalidUser string, err error)
WechatPushMsg wechat push text message to specified user