MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / NewHTTPServer

Function NewHTTPServer

backend/pkg/httpserver/server.go:261–284  ·  view source on GitHub ↗
(
	port string,
	baseURL *url.URL,
	metadataStorer WebFeatureMetadataStorer,
	wptMetricsStorer WPTMetricsStorer,
	eventPublisher EventPublisher,
	rawBytesDataCacher RawBytesDataCacher,
	routeCacheOptions RouteCacheOptions,
	userGitHubClientFactory UserGitHubClientFactory,
	preRequestValidationMiddlewares []func(http.Handler) http.Handler,
	authMiddleware func(http.Handler) http.Handler)

Source from the content-addressed store, hash-verified

259// This interface is intended for use in scenarios where data needs to be
260// cached as raw bytes, rather than structured data types.
261// Implementations of this interface should provide methods to store and
262// retrieve byte slices associated with string keys.
263// Currently implemented by the valkey cache layer.
264type RawBytesDataCacher interface {
265 // Cache stores a value associated with a key in the cache.
266 Cache(context.Context, string, []byte, ...cachetypes.CacheOption) error
267 // Get retrieves a value from the cache by its key.
268 Get(context.Context, string) ([]byte, error)
269}
270
271// RouteCacheOptions contains options for caching routes.
272type RouteCacheOptions struct {
273 // AggregatedFeatureStatsOptions applies cache options for routes that only contain stats on features.
274 // Any routes with multiple data sources are not included (e.g. WPT Metrics)
275 AggregatedFeatureStatsOptions []cachetypes.CacheOption
276}
277
278type EventPublisher interface {
279 PublishSearchConfigurationChanged(ctx context.Context, resp *backend.SavedSearchResponse,
280 userID string, isCreation bool) error
281 PublishCodeScanTask(ctx context.Context, task codescantaskv1.CodeScanTaskEvent) error
282}
283
284type WebhookVerifier interface {
285 VerifySignature(payload []byte, signature string) error
286}
287

Callers

nothing calls this directly

Calls 3

NewRSSRendererFunction · 0.85

Tested by

no test coverage detected