goutils

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 2 Imported by: 0

README

goutils

Test status

Various reusable Go utilities and modules

httplogger

Logging middleware for HTTP requests using go-ethereum/log. See examples/httplogger/main.go

Install:

go get github.com/flashbots/goutils/httplogger

Use:

mux := http.NewServeMux()
mux.HandleFunc("/v1/hello", HelloHandler)
loggedRouter := httplogger.LoggingMiddleware(r)

Documentation

Overview

Package goutils implements various reusable utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

CheckErr panics if err is not nil

func GetEnv

func GetEnv(key string, defaultValue string) string

GetEnv returns the value of the environment variable named by key, or defaultValue if the environment variable doesn't exist

func GetEnvInt

func GetEnvInt(key string, defaultValue int) int

GetEnvInt returns the value of the environment variable named by key, or defaultValue if the environment variable doesn't exist or is not a valid integer

Types

This section is empty.

Directories

Path Synopsis
examples
httplogger command
Package httplogger implements a middleware that logs the incoming HTTP request & its duration using go-ethereum-log.
Package httplogger implements a middleware that logs the incoming HTTP request & its duration using go-ethereum-log.

Jump to

Keyboard shortcuts

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