mainboilerplate

package
v2.0.206+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package mainboilerplate contains shared boilerplate for this project's programs. The idea is to provide a selection of narrowly scoped methods so callers do not have to buy-in to an all-or-nothing approach.

Importing this package will automatically register net/http/pprof HTTP handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Initialize performs an opinionated program initialization. The intention is for this to be one-size-fits-all for gazette programs with each program specifying additional flags before calling this.

func LogPanic

func LogPanic()

LogPanic is intended to be a deferred call to log a panic at the end of the program's lifecycle.

func RegisterSignalHandlers

func RegisterSignalHandlers()

RegisterSignalHandlers registers signal handlers for debugging and profiling.

SIGQUIT

Dump a one-time heap and goroutine trace to stdout.

SIGUSR1

Start a long-running CPU profile using pprof. The profile is written to
/var/tmp/profile_${PID}_${TIMESTAMP}.pprof where TIMESTAMP is the epoch
time when the profiling session began. Sending SIGUSR1 again will stop the
profiling and flush writes for the profile.

SIGUSR2

Toggle debug log level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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