This section is empty.


This section is empty.


func HTTPErrf

func HTTPErrf(resp http.ResponseWriter, statusCode int, message string, rest ...interface{})

HTTPErrf logs and returns an error on the response.


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.

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.

Source Files