handlers

package
v0.0.0-...-cab28d8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// WebhooksHTTPClientTimeout represents the timeout of the http client used
	// to handle the webhooks requests.
	WebhooksHTTPClientTimeout = 60 * time.Second
)

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	Router http.Handler

	Organizations *org.Handlers
	Users         *user.Handlers
	Packages      *pkg.Handlers
	Repositories  *repo.Handlers
	Subscriptions *subscription.Handlers
	Webhooks      *webhook.Handlers
	APIKeys       *apikey.Handlers
	Static        *static.Handlers
	Stats         *stats.Handlers
	// contains filtered or unexported fields
}

Handlers groups all the http handlers defined for the hub, including the router in charge of sending requests to the right handler.

func Setup

func Setup(ctx context.Context, cfg *viper.Viper, svc *Services) (*Handlers, error)

Setup creates a new Handlers instance.

func (*Handlers) MetricsCollector

func (h *Handlers) MetricsCollector(next http.Handler) http.Handler

MetricsCollector is an http middleware that collects some metrics about requests processed.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics groups some metrics collected from a Handlers instance.

type Services

type Services struct {
	OrganizationManager hub.OrganizationManager
	UserManager         hub.UserManager
	RepositoryManager   hub.RepositoryManager
	PackageManager      hub.PackageManager
	SubscriptionManager hub.SubscriptionManager
	WebhookManager      hub.WebhookManager
	APIKeyManager       hub.APIKeyManager
	StatsManager        hub.StatsManager
	ImageStore          img.Store
	Authorizer          hub.Authorizer
	HTTPClient          hub.HTTPClient
	OCIPuller           hub.OCIPuller
	ViewsTracker        hub.ViewsTracker
}

Services is a wrapper around several internal services used by the handlers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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