modrevision

package
v12.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) context.Handler

New returns an Iris Handler which renders the server name (env), build information (if available) and an OK message. The handler displays simple debug information such as build commit id and time. It does NOT render information about the Go language itself or any operating system confgiuration for security reasons.

Example Code:

app.Get("/health", modrevision.New(modrevision.Options{
 ServerName:   "Iris Server",
 Env:          "development",
 Developer:    "kataras",
 TimeLocation: time.FixedZone("Greece/Athens", 7200),
}))

Types

type Options

type Options struct {
	// The ServerName, e.g. Iris Server.
	ServerName string
	// The Environment, e.g. development.
	Env string
	// The Developer, e.g. kataras.
	Developer string
	// True to display the build time as unix (seconds).
	UnixTime bool
	// A non nil time location value to customize the display of the build time.
	TimeLocation *time.Location
}

Options holds the necessary values to render the server name, environment and build information. See the `New` package-level function.

Jump to

Keyboard shortcuts

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