-
Notifications
You must be signed in to change notification settings - Fork 3
/
structs.go
63 lines (53 loc) · 1.54 KB
/
structs.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"context"
"github.com/shurcooL/githubv4"
)
// PullRequest : A pullRequest
type PullRequest struct {
CreatedAt githubv4.DateTime `json:"createdAt"`
URL string `json:"url"`
Owner githubv4.String `json:"owner"`
ReviewDecision githubv4.String `json:"reviewDecision"`
Mergeable githubv4.String `json:"mergeable"`
}
// Repo : Struct for repo providing NameWithOwner
type Repo struct {
NameWithOwner githubv4.String `json:"nameWithOwner"`
}
// PullRequestEdge : A PullRequestEdge
type PullRequestEdge struct {
Node struct {
URL githubv4.URI
CreatedAt githubv4.DateTime
IsDraft githubv4.Boolean
Author struct {
Login githubv4.String
}
ReviewDecision githubv4.String
Mergeable githubv4.String
}
}
// RepositoryEdge : Graphql edge for repository
type RepositoryEdge struct {
Node RepositoryNode
}
// RepositoryNode : Graphql node for repository
type RepositoryNode struct {
NameWithOwner githubv4.String
RepositoryTopics struct {
Nodes []RepositoryTopicNode
} `graphql:"repositoryTopics(first: 100)"`
}
// RepositoryTopicNode : Struct for the repository topic
type RepositoryTopicNode struct {
Topic struct {
Name string
}
}
// You can write a function that accepts an interface as an argument,
// and then pass either MockClient or githubv4.Client to it.
// Client : A arbitrary interface to support either MockClient or githubv4.Client
type Client interface {
Query(ctx context.Context, q interface{}, variables map[string]interface{}) error
}