Documentation ¶
Index ¶
- func Fetch(c *gin.Context)
- func GetLastID(ctx context.Context, projectID, dsn, owner, repository string) (int64, int64, error)
- func Items(owner, repository string, p dataset.PullReq, list []*github.RepositoryCommit) []interface{}
- func ListPullReqs(ctx context.Context, projectID, dsn, owner, repository string, lastID int64, ...) ([]dataset.PullReq, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Items ¶ added in v0.0.6
func Items(owner, repository string, p dataset.PullReq, list []*github.RepositoryCommit) []interface{}
Example ¶
package main import ( "fmt" "time" "github.com/google/go-github/v40/github" "github.com/itsubaki/fourkeys/dataset" "github.com/itsubaki/fourkeys/handler/pullreqs/commits" ) func main() { items := commits.Items("itsubaki", "fourkeys", dataset.PullReq{ ID: 1234, }, []*github.RepositoryCommit{ { SHA: github.String("1234567890"), Commit: &github.Commit{ Committer: &github.CommitAuthor{ Date: &time.Time{}, }, }, }, }) for _, item := range items { c := item.(dataset.PullReqCommit) fmt.Printf("%v %v\n", c.ID, c.SHA) } }
Output: 1234 1234567890
func ListPullReqs ¶
func ListPullReqs(ctx context.Context, projectID, dsn, owner, repository string, lastID int64, limit string) ([]dataset.PullReq, error)
Example ¶
package main import ( "context" "fmt" "log" "os" "github.com/itsubaki/fourkeys/handler/pullreqs/commits" ) func main() { prs, err := commits.ListPullReqs(context.Background(), os.Getenv("PROJECT_ID"), os.Getenv("DATASET_NAME"), "itsubaki", "fourkeys", 0, "5") if err != nil { log.Fatalf("list pullreqs: %v", err) } for _, pr := range prs { fmt.Printf("%v(%v)\n", pr.ID, pr.Number) } }
Output: 955942047(1) 956961787(2) 971456366(4) 1058764804(5) 1066891742(6)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.