profutils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

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

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"`
}

Jump to

Keyboard shortcuts

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