server

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(h http.HandlerFunc, m ...middleware) http.HandlerFunc

Prepend the middlewares to the handler in the order they are provided.

func DecodeJSONBody

func DecodeJSONBody[T any]() middleware

func InitMux

func InitMux(
	ss *scrapeServer,
	db *database.DBHandle,
	openHome bool,
	enableProfiling bool,
) (*http.ServeMux, error)

Mux Initialization Arguments:

  • ss: scrapeServer: used for setting up API routes
  • db: database.DBHandle: used for healthchecks
  • openHome: bool: if true, the the page will always be open, even if auth is enabled
  • enableProfiling: bool: if true, pprof routes will be added to the mux

func MaxBytes

func MaxBytes(n int64) middleware

func MustScrapeServer added in v0.8.5

func MustScrapeServer(ctx context.Context, opts ...option) *scrapeServer

func NewScrapeServer

func NewScrapeServer(ctx context.Context, opts ...option) (*scrapeServer, error)

When the context passed here is cancelled, the associated fetcher will close and release any resources they have open.

func WithAuthorizationIf added in v0.8.5

func WithAuthorizationIf(key auth.HMACBase64Key) option

func WithFeedFetcher added in v0.8.5

func WithFeedFetcher(ff fetch.FeedFetcher) option

func WithHeadlessIf added in v0.8.5

func WithHeadlessIf(hf fetch.URLFetcher) option

func WithURLFetcher added in v0.8.5

func WithURLFetcher(f fetch.URLFetcher) option

Types

type BatchRequest

type BatchRequest struct {
	Urls []string `json:"urls"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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