envsvc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package envsvc provides convenience methods for using env with services.

It exposes these variables via HTTP at /debug/env in JSON format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns the env HTTP Handler.

This is only needed to install the handler in a non-standard location.

func Parse

func Parse()

Parse is equivalent to ParseWithExitFn(os.Exit).

func ParseWithExitFn added in v0.2.0

func ParseWithExitFn(exitFn func(int))

ParseWithExitFn registers command line arguments -env-check, -env-dump, -env-dump-yaml and calls env.Parse(). Any errors are written to stderr and then exitFn(1) is called.

Registered flags: -env-dump: skips parsing step and writes each env.Var to stderr, calls exitFn(0) when done. -env-dump-yaml: skips parsing steps and write each env.Var to stderr in YAML format, calls os.Exit(0) when done. -env-check: calls exitFn(0) if env.Parse() succeeds without error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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