Documentation
¶
Index ¶
- func Fetch(c *gin.Context)
- func GetLastID(ctx context.Context, projectID, dsn, owner, repository string) (int64, error)
- func GetLastPullReqsCommits(ctx context.Context, projectID, dsn, owner, repository string) (int64, error)
- func ListPullReqs(ctx context.Context, projectID, dsn, owner, repository, state, limit string) ([]dataset.PullReq, error)
- func Update(c *gin.Context)
- func UpdatePullReq(ctx context.Context, projectID, dsn string, r *github.PullRequest) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastPullReqsCommits ¶ added in v0.0.5
func ListPullReqs ¶
func ListPullReqs(ctx context.Context, projectID, dsn, owner, repository, state, limit string) ([]dataset.PullReq, error)
Example ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/itsubaki/fourkeys/handler/pullreqs"
)
func main() {
// https://github.com/itsubaki/fourkeys/pulls?q=is%3Apr+is%3Aclosed
prs, err := pullreqs.ListPullReqs(context.Background(), os.Getenv("PROJECT_ID"), "fourkeys", "itsubaki", "fourkeys", "closed", "3")
if err != nil {
log.Fatalf("list pullreqs: %v", err)
}
for _, pr := range prs {
fmt.Printf("%v %v %v\n", pr.ID, pr.Number, pr.State)
}
}
Output: 955942047 1 closed 956961787 2 closed 971456366 4 closed
func UpdatePullReq ¶
Example ¶
package main
import (
"context"
"log"
"os"
"time"
"github.com/google/go-github/v40/github"
"github.com/itsubaki/fourkeys/handler/pullreqs"
)
func main() {
if err := pullreqs.UpdatePullReq(context.Background(), os.Getenv("PROJECT_ID"), "fourkeys", &github.PullRequest{
ID: github.Int64(-1), // not exists. no effect.
ClosedAt: &time.Time{},
}); err != nil {
log.Fatalf("update pullreq: %v", err)
}
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.