common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package common contains common utilities and functions used by the service.

Index

Constants

View Source
const (
	PackageName = "github.com/flashbots/system-api"
)

Variables

View Source
var Version = "dev"

Functions

func GetEnvInt

func GetEnvInt(key string, defaultValue int) int

func LoggingMiddlewareSlog

func LoggingMiddlewareSlog(logger *slog.Logger, next http.Handler) http.Handler

LoggingMiddlewareSlog logs the incoming HTTP request & its duration.

func SetupLogger

func SetupLogger(opts *LoggingOpts) (log *slog.Logger)

Types

type LoggingOpts

type LoggingOpts struct {
	Debug   bool
	JSON    bool
	Service string
	Version string
}

Jump to

Keyboard shortcuts

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