github

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 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 100

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 NewIssuesModule

func NewIssuesModule(opts *Options) sqlite.Module

func NewOrgReposModule

func NewOrgReposModule(opts *Options) sqlite.Module

func NewPRModule

func NewPRModule(opts *Options) sqlite.Module

func NewProtectionsModule added in v0.4.7

func NewProtectionsModule(opts *Options) sqlite.Module

func NewRepoFileContentFunc

func NewRepoFileContentFunc(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
	// 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