Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IPWhitelist ¶ added in v1.4.0
IPWhitelist returns a middleware that checks if the IP of the client is in the whitelist. It always checks against the original TCP connection IP (stored in context by newRealIPMiddleware), so the whitelist cannot be bypassed via forwarded headers.
func SetExampleCert ¶
SetExampleCert sets the example certificate to be used in the example endpoints.
Types ¶
type Server ¶ added in v1.10.0
type Server struct {
// contains filtered or unexported fields
}
Server is a struct that holds the necessary information to run a webserver. It is used for the websocket server as well as the metrics server.
func NewMetricsServer ¶
NewMetricsServer creates a new webserver that listens on the given port and provides metrics for a metrics server.
func NewWebsocketServer ¶
NewWebsocketServer starts a new webserver and initialized it with the necessary routes. It also takes care of setting up websocket.Upgrader.
func (*Server) RegisterPrometheus ¶ added in v1.10.0
func (ws *Server) RegisterPrometheus(url string, callback func(w io.Writer, exposeProcessMetrics bool))
RegisterPrometheus registers a new handler that listens on the given url and calls the given function in order to provide metrics for a prometheus server. This function signature was used, because VictoriaMetrics offers exactly this function signature.