api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package api provides a service that handles HTTP requests using JSON-encoded messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	http.Handler
	Metrics() (cs []prometheus.Collector)
}

Handler is an http.Handler with exposed metrics.

func New

func New(o Options) (h Handler, err error)

New initializes a new Handler with provided options.

type Options

type Options struct {
	Version          string
	Headers          map[string]string
	RealIPHeaderName string

	Logger       *slog.Logger
	AccessLogger *slog.Logger

	RecoveryService *recovery.Service

	PasswordsService passwords.Service
}

Options structure contains optional properties for the Handler.

Jump to

Keyboard shortcuts

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