api

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package api contains implementation of bootstrap service HTTP API.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrBootstrap indicates error in getting bootstrap configuration.
	ErrBootstrap = errors.New("failed to read bootstrap configuration")
)

Functions

func LoggingMiddleware

func LoggingMiddleware(svc bootstrap.Service, logger *slog.Logger) bootstrap.Service

LoggingMiddleware adds logging facilities to the bootstrap service.

func MakeHandler

func MakeHandler(svc bootstrap.Service, reader bootstrap.ConfigReader, logger *slog.Logger, instanceID string) http.Handler

MakeHandler returns a HTTP handler for API endpoints.

func MetricsMiddleware

func MetricsMiddleware(svc bootstrap.Service, counter metrics.Counter, latency metrics.Histogram) bootstrap.Service

MetricsMiddleware instruments core service by tracking request count and latency.

Types

This section is empty.

Jump to

Keyboard shortcuts

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