version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version provides middleware that exposes an application's version. It sets an X-Version header on every response and, when a request targets the configured path, replies with a small JSON document reporting the version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Options) express.Handler

New returns version middleware configured by opts.

Types

type Options

type Options struct {
	// Version is the version string reported. Defaults to "unknown".
	Version string
	// Path is the endpoint that returns the version as JSON. Defaults to
	// "/version".
	Path string
	// Header is the response header name. Defaults to "X-Version".
	Header string
}

Options configures the version middleware.

Jump to

Keyboard shortcuts

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