Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.