github

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitHubPerPageFromCtx

func GetGitHubPerPageFromCtx(ctx services.Context) int

GetGitHubPerPageFromCtx looks up the githubPerPage key in the supplied context and returns it if set, otherwise it returns a default of 50

func GetGitHubRateLimitFromCtx

func GetGitHubRateLimitFromCtx(ctx services.Context) *rate.Limiter

GetGitHubRateLimitFromCtx looks up the githubRateLimit key in the supplied context and parses it to return a client side rate limit in the form "(number of reqs)/(number of seconds)". For instance a string "2/3" would yield a rate limiter that permis 2 requests every 3 seconds. A single integer is also permitted, which assumes the "denominator" is 1 second. So a value of "5" would simple mean 5 requests per second. If the string cannot be parsed, nil is returned.

func GetGitHubTokenFromCtx

func GetGitHubTokenFromCtx(ctx services.Context) string

GetGitHubTokenFromCtx looks up the githubToken key in the supplied context and returns it if set

func NewBranchModule

func NewBranchModule(opts *Options) sqlite.Module

func NewGitHubUserFunc

func NewGitHubUserFunc(opts *Options) sqlite.Function

func NewIssueCommentsModule

func NewIssueCommentsModule(opts *Options) sqlite.Module

func NewIssuesModule

func NewIssuesModule(opts *Options) sqlite.Module

func NewOrgAuditModule

func NewOrgAuditModule(opts *Options) sqlite.Module

func NewOrgReposModule

func NewOrgReposModule(opts *Options) sqlite.Module

func NewPRCommentsModule

func NewPRCommentsModule(opts *Options) sqlite.Module

func NewPRCommitsModule

func NewPRCommitsModule(opts *Options) sqlite.Module

func NewPRModule

func NewPRModule(opts *Options) sqlite.Module

func NewPRReviewsModule

func NewPRReviewsModule(opts *Options) sqlite.Module

func NewProtectionsModule

func NewProtectionsModule(opts *Options) sqlite.Module

func NewRepoCommitsModule

func NewRepoCommitsModule(opts *Options) sqlite.Module

func NewRepoFileContentFunc

func NewRepoFileContentFunc(opts *Options) sqlite.Function

func NewRepoInfoFunc

func NewRepoInfoFunc(opts *Options) sqlite.Function

func NewStargazersModule

func NewStargazersModule(opts *Options) sqlite.Module

func NewStarredReposFunc

func NewStarredReposFunc(opts *Options) sqlite.Function

func NewStarredReposModule

func NewStarredReposModule(opts *Options) sqlite.Module

func NewUserReposModule

func NewUserReposModule(opts *Options) sqlite.Module

func Register

func Register(ext *sqlite.ExtensionApi, opt *options.Options) (_ sqlite.ErrorCode, err error)

Register registers GitHub related functionality as a SQLite extension

Types

type Options

type Options struct {
	Client                func() *githubv4.Client
	RateLimiter           *rate.Limiter
	RateLimitHandler      func(*options.GitHubRateLimitResponse)
	GitHubPreRequestHook  func()
	GitHubPostRequestHook func()
	// PerPage is the default number of items per page to use when making a paginated GitHub API request
	PerPage int
	Logger  *zerolog.Logger
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL