admin

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 41

Documentation

Overview

Package admin implements an http.Server which can be used for operations and monitoring tools. It's designed to be shipped (and ran) inside an existing Go service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns an http.Handler for the admin http service. This contains metrics and pprof handlers.

No metrics specific to the handler are recorded.

We only want to expose on the admin servlet because these profiles/dumps can contain sensitive info (raw memory).

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents a holder around a net/http Server which is used for admin endpoints. (i.e. metrics, healthcheck)

func NewServer

func NewServer(addr string) *Server

NewServer returns an admin Server instance that handles Prometheus metrics and pprof requests.

func (*Server) BindAddr

func (s *Server) BindAddr() string

BindAddr returns the server's bind address. This is in Go's format so :8080 is valid.

func (*Server) Listen

func (s *Server) Listen() error

Listen brings up the admin HTTP server. This call blocks until the server is Shutdown or panics.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown unbinds the HTTP server.

Jump to

Keyboard shortcuts

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