Go client library for accessing the GitHub API v3
Agent Success
Agent success rate when using this tile
65%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.14x
Baseline
Agent success rate without this tile
57%
Build a small library that lists repository webhooks with page-number pagination and walks webhook delivery history with cursor-based pagination, exposing navigation data so callers can follow subsequent pages or stop when finished.
after/before/page token) and a page size, returning delivery summaries plus the next/previous cursor tokens needed to continue traversal. @testmaxDeliveries items by following delivery cursors until the limit is hit or no further pages are available, keeping the newest-first ordering used by the API. @test@generates
type HookSummary struct {
ID int64
Name string
TargetURL string
Active bool
}
type HookPageResult struct {
Hooks []HookSummary
Page int
NextPage int
PrevPage int
FirstPage int
LastPage int
}
type DeliverySummary struct {
ID int64
Event string
Status string
Redelivery bool
}
type DeliveryPageResult struct {
Deliveries []DeliverySummary
After string
Before string
NextCursor string
HasNext bool
HasPrev bool
}
type Pager interface {
ListHooks(ctx context.Context, owner, repo string, page, perPage int) (HookPageResult, error)
ListDeliveries(ctx context.Context, owner, repo string, hookID int64, after, before string, perPage int) (DeliveryPageResult, error)
CollectDeliveries(ctx context.Context, owner, repo string, hookID int64, maxDeliveries int, perPage int) ([]DeliverySummary, error)
}
// NewPager returns an implementation backed by a GitHub REST client.
// token may be empty for unauthenticated requests.
func NewPager(httpClient *http.Client, token string) PagerTyped GitHub REST client with pagination helpers.
HTTP client configuration.
tessl i tessl/golang-github-com-google-go-github@79.0.1docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10