Versions in this module Expand all Collapse all v30 v30.0.0 Mar 20, 2020 Changes in this version + const DefaultCachingClientCapacity + const DefaultWebhookRoute + const LogKeyDeliveryID + const LogKeyEventType + const LogKeyInstallationID + const LogKeyPRNum + const LogKeyRepositoryName + const LogKeyRepositoryOwner + const MetricsKeyRateLimit + const MetricsKeyRateLimitRemaining + const MetricsKeyRequests + const MetricsKeyRequests2xx + const MetricsKeyRequests3xx + const MetricsKeyRequests4xx + const MetricsKeyRequests5xx + const MetricsKeyRequestsCached + func DefaultErrorCallback(w http.ResponseWriter, r *http.Request, err error) + func DefaultResponseCallback(w http.ResponseWriter, r *http.Request, event string, handled bool) + func GetInstallationIDFromEvent(event InstallationSource) int64 + func GetResponder(ctx context.Context) func(http.ResponseWriter, *http.Request) + func NewDefaultEventDispatcher(c Config, handlers ...EventHandler) http.Handler + func NewEventDispatcher(handlers []EventHandler, secret string, opts ...DispatcherOption) http.Handler + func PreparePRContext(ctx context.Context, installationID int64, repo *github.Repository, number int) (context.Context, zerolog.Logger) + func PrepareRepoContext(ctx context.Context, installationID int64, repo *github.Repository) (context.Context, zerolog.Logger) + func SetResponder(ctx context.Context, responder func(http.ResponseWriter, *http.Request)) + type ClientCreator interface + NewAppClient func() (*github.Client, error) + NewAppV4Client func() (*githubv4.Client, error) + NewInstallationClient func(installationID int64) (*github.Client, error) + NewInstallationV4Client func(installationID int64) (*githubv4.Client, error) + NewTokenClient func(token string) (*github.Client, error) + NewTokenV4Client func(token string) (*githubv4.Client, error) + func NewCachingClientCreator(delegate ClientCreator, capacity int) (ClientCreator, error) + func NewClientCreator(v3BaseURL, v4BaseURL string, integrationID int64, privKeyBytes []byte, ...) ClientCreator + func NewDefaultCachingClientCreator(c Config, opts ...ClientOption) (ClientCreator, error) + type ClientMiddleware func(http.RoundTripper) http.RoundTripper + func ClientLogging(lvl zerolog.Level) ClientMiddleware + func ClientMetrics(registry metrics.Registry) ClientMiddleware + type ClientOption func(c *clientCreator) + func WithClientCaching(alwaysValidate bool, cache func() httpcache.Cache) ClientOption + func WithClientMiddleware(middleware ...ClientMiddleware) ClientOption + func WithClientUserAgent(agent string) ClientOption + type Config struct + App struct{ ... } + OAuth struct{ ... } + V3APIURL string + V4APIURL string + WebURL string + func (c *Config) SetValuesFromEnv(prefix string) + type DispatcherOption func(*eventDispatcher) + func WithErrorCallback(onError ErrorCallback) DispatcherOption + func WithResponseCallback(onResponse ResponseCallback) DispatcherOption + type ErrorCallback func(w http.ResponseWriter, r *http.Request, err error) + type EventHandler interface + Handle func(ctx context.Context, eventType, deliveryID string, payload []byte) error + Handles func() []string + type Installation struct + ID int64 + Owner string + OwnerID int64 + type InstallationNotFound string + func (err InstallationNotFound) Error() string + type InstallationSource interface + GetInstallation func() *github.Installation + type InstallationsService interface + GetByOwner func(ctx context.Context, owner string) (Installation, error) + ListAll func(ctx context.Context) ([]Installation, error) + func NewInstallationsService(appClient *github.Client) InstallationsService + type ResponseCallback func(w http.ResponseWriter, r *http.Request, event string, handled bool) + type ValidationError struct + Cause error + DeliveryID string + EventType string + func (ve ValidationError) Error() string