profutils

package
v2.0.15 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartProfilingServer

func StartProfilingServer(ctx context.Context, pprofPort int) error

Starts an http server on the given port

func StartProfilingServerWithDefaultHandlers

func StartProfilingServerWithDefaultHandlers(ctx context.Context, pprofPort int, handlers map[string]http.Handler) error

StartProfilingServerWithDefaultHandlers forwards the call to StartProfilingServer Also registers: 1. the prometheus HTTP handler on '/metrics' path shared with the profiling server. 2. A healthcheck (L7) handler on '/healthcheck'. 3. A version handler on '/version' provides information about the specific build. 4. A config handler on '/config' provides a dump of the currently loaded config.

func WriteJSONResponse

func WriteJSONResponse(resp http.ResponseWriter, code int, body interface{}) error

Writes a JSON to the http output stream

func WriteStringResponse

func WriteStringResponse(resp http.ResponseWriter, code int, body string) error

Writes a string to the Http output stream

Types

type BuildVersion

type BuildVersion struct {
	Build     string `json:"build"`
	Version   string `json:"version"`
	Timestamp string `json:"timestamp,string"`
}

type Config added in v2.0.8

type Config struct {
	DisableConfigEndpoint bool `config:"DisableConfigEndpoint"`
}

func GetConfig added in v2.0.8

func GetConfig() *Config

func (Config) GetPFlagSet added in v2.0.8

func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in Config and its nested types. The format of the flags is json-name.json-sub-name... etc.

Jump to

Keyboard shortcuts

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