ops

package
v0.0.0-...-3ea6822 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadynessHandler

func NewReadynessHandler() *readynessHandler

NewReadynessHandler returns a new readynessHandler set to the unready state.

func NewServer

func NewServer(ctx context.Context, handler http.Handler, cfg *HttpConfig) *server

func RegisterMetrics

func RegisterMetrics(r prometheus.Registerer) error

Types

type HttpConfig

type HttpConfig struct {
	ListenAddr   string
	Logger       zerolog.Logger
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	IdleTimeout  time.Duration
}

type Mux

type Mux struct {
	// contains filtered or unexported fields
}

func NewMux

func NewMux(opts *MuxOpts) *Mux

NewMux returns an http.Handler configured to serve metrics, readiness and debug endpoints.

func (*Mux) ServeHTTP

func (mux *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type MuxOpts

type MuxOpts struct {
	Logger           zerolog.Logger
	DefaultHandler   http.Handler
	ReadynessHandler *readynessHandler
	PromRegisterer   interface {
		prometheus.Registerer
		prometheus.Gatherer
	}
}

Jump to

Keyboard shortcuts

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