-
Notifications
You must be signed in to change notification settings - Fork 13
/
provider.go
39 lines (29 loc) · 982 Bytes
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package issues
import (
"time"
"github.com/jenkins-x/go-scm/scm"
)
type IssueProvider interface {
// GetIssue returns the issue of the given key
GetIssue(key string) (*scm.Issue, error)
// SearchIssues searches for issues (open by default)
SearchIssues(query string) ([]*scm.Issue, error)
// SearchIssuesClosedSince searches the issues closed since the given da
SearchIssuesClosedSince(t time.Time) ([]*scm.Issue, error)
// Creates a new issue in the current project
CreateIssue(issue *scm.Issue) (*scm.Issue, error)
// Creates a comment on the given issue
CreateIssueComment(key string, comment string) error
// IssueURL returns the URL of the given issue for this project
IssueURL(key string) string
// HomeURL returns the home URL of the issue tracker
HomeURL() string
}
// GetIssueProvider returns the kind of issue provider
func GetIssueProvider(tracker IssueProvider) string {
_, ok := tracker.(*JiraService)
if ok {
return Jira
}
return Git
}