Documentation ¶
Index ¶
- func Chain(h http.HandlerFunc, m ...middleware) http.HandlerFunc
- func DecodeJSONBody[T any]() middleware
- func InitMux(ss *scrapeServer, db *database.DBHandle, openHome bool, enableProfiling bool) (*http.ServeMux, error)
- func MaxBytes(n int64) middleware
- func MustScrapeServer(ctx context.Context, opts ...option) *scrapeServer
- func NewScrapeServer(ctx context.Context, opts ...option) (*scrapeServer, error)
- func WithAuthorizationIf(key auth.HMACBase64Key) option
- func WithFeedFetcher(ff fetch.FeedFetcher) option
- func WithHeadlessIf(hf fetch.URLFetcher) option
- func WithURLFetcher(f fetch.URLFetcher) option
- type BatchRequest
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 MustScrapeServer ¶ added in v0.8.5
func NewScrapeServer ¶
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"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.