admin

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 2

Documentation

Overview

Package admin provides simple admin http server API.

Index

Constants

View Source
const (
	// TraceFilterOn toggle
	TraceFilterOn int32 = 0
	// TraceFilterOff toggle
	TraceFilterOff int32 = 1
)

Variables

This section is empty.

Functions

func DisableTrace

func DisableTrace(w http.ResponseWriter, _ *http.Request)

DisableTrace ...

func EnableTrace

func EnableTrace(w http.ResponseWriter, _ *http.Request)

EnableTrace ...

func TraceDisabled

func TraceDisabled() bool

TraceDisabled ...

func TraceStatus

func TraceStatus(w http.ResponseWriter, _ *http.Request)

TraceStatus ...

Types

type Option

type Option func(o *Options)

Option is function for applying an option the admin server

func WithAddr

func WithAddr(addr string) Option

WithAddr set server listen addr

func WithEnableHotSwitch

func WithEnableHotSwitch(enable bool) Option

WithEnableHotSwitch set whether to enable hot switch http handler

func WithEnablePprof

func WithEnablePprof(enable bool) Option

WithEnablePprof set whether to enable go pprof http handler

func WithEnablePrometheus

func WithEnablePrometheus(enable bool) Option

WithEnablePrometheus set whether to enable prometheus metrics http handler

func WithEnableZPage

func WithEnableZPage(enable bool) Option

WithEnableZPage set up zPages processor

type Options

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

Options represents config options for open telemetry http admin server

type Server

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

Server is admin server, wrap http.Server

func NewServer

func NewServer(opts ...Option) (*Server, error)

NewServer creates a Server instance

func (*Server) HTTPServer

func (s *Server) HTTPServer() *http.Server

HTTPServer returns http.Server in Server

func (*Server) Serve

func (s *Server) Serve() error

Serve starts a http server and listen to serve

Jump to

Keyboard shortcuts

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