endpoint

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPErrf

func HTTPErrf(resp http.ResponseWriter, statusCode int, message string, rest ...any)

HTTPErrf logs and returns an error on the response.

Types

type FlagsEndpoint

type FlagsEndpoint struct {
	// contains filtered or unexported fields
}

FlagsEndpoint is a collection of `http.HandlerFunc` that serve debug pages about a given `FlagSet.

func NewFlagsEndpoint

func NewFlagsEndpoint(flagSet *flag.FlagSet, setURL string) *FlagsEndpoint

NewFlagsEndpoint creates a new debug `http.HandlerFunc` collection for a given `FlagSet` and an optional URL for Setter (needs to be secured). if setURL is empty, no setter function will be enabled. Also sets up `loglevel` flag as a dynamic flag.

func (*FlagsEndpoint) ListFlags

func (e *FlagsEndpoint) ListFlags(resp http.ResponseWriter, req *http.Request)

ListFlags provides an HTML and JSON `http.HandlerFunc` that lists all Flags of a `FlagSet`. Additional URL query parameters can be used such as `type=[dynamic,static]` or `only_changed=true`.

func (*FlagsEndpoint) SetFlag

func (e *FlagsEndpoint) SetFlag(resp http.ResponseWriter, req *http.Request)

SetFlag updates a dynamic flag to a new value.

Jump to

Keyboard shortcuts

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