Documentation ¶
Index ¶
- type GitlabClient
- type Policy
- type Repository
- type Service
- func (s *Service) Close() error
- func (s *Service) GetAuthoredReviewedMRs(team *ds.Team, users []*ds.User) (authorToMR, reviewerToMR map[int][]*ds.MergeRequest, err error)
- func (s *Service) SubscribeOnProjects(pullPeriod time.Duration) error
- func (s *Service) SubscribeOnSlack() error
- func (s *Service) TeamNotification(team *ds.Team, authorToMR, reviewerToMR map[int][]*ds.MergeRequest) (message string, err error)
- func (s *Service) UserNotification(user *ds.User, team *ds.Team, ...) (message string, err error)
- type SlackClient
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitlabClient ¶
type Policy ¶
type Policy interface { // ProcessChanges may add new reviewers or do some actions ProcessChanges(team *ds.Team, mr *ds.MergeRequest) (err error) // ApprovedByUser checks if merge request is approved by passed users ApprovedByUser(team *ds.Team, mr *ds.MergeRequest, byAll ...*ds.BasicUser) bool // ApprovedByPolicy checks if merge request is approved by policy conditions ApprovedByPolicy(team *ds.Team, mr *ds.MergeRequest) bool }
type Repository ¶
type Repository interface { Teams() ([]*ds.Team, error) Projects() ([]*ds.Project, error) MergeRequestByID(id int) (*ds.MergeRequest, error) MergeRequestsByProject(projectID int) ([]*ds.MergeRequest, error) MergeRequestsByAuthor(authorID []int) ([]*ds.MergeRequest, error) MergeRequestsByReviewer(reviewerID []int) ([]*ds.MergeRequest, error) UpsertMergeRequest(mr *ds.MergeRequest) error UserBySlackID(slackID string) (*ds.User, *ds.Team, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(r Repository, g GitlabClient, p map[ds.PolicyName]Policy, slack SlackClient) (*Service, error)
func (*Service) GetAuthoredReviewedMRs ¶
func (*Service) SubscribeOnProjects ¶
SubscribeOnProjects Creates workers for each project and subscribe on merge requests changes
func (*Service) SubscribeOnSlack ¶
func (*Service) TeamNotification ¶
type SlackClient ¶
type SlackClient interface { worker.SlackClient Subscribe() (chan ds.UserEvent, error) }
Click to show internal directories.
Click to hide internal directories.