debug

package
v0.33.5-rc2-monkit Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package debug implements debug server for satellite and storage node.

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("debug")

Error is default error class for debug package.

Functions

This section is empty.

Types

type Button

type Button struct {
	Slug string
	Name string
	Call func(progress io.Writer) error
}

Button defines a clickable button.

type ButtonGroup

type ButtonGroup struct {
	Slug    string
	Name    string
	Buttons []*Button
}

ButtonGroup contains description of a collection of buttons.

func Cycle

func Cycle(name string, cycle *sync2.Cycle) *ButtonGroup

Cycle returns button group for a cycle

type Config

type Config struct {
	Address string `internal:"true"`

	ControlTitle string `internal:"true"`
	Control      bool   `help:"expose control panel" releaseDefault:"false" devDefault:"true"`
}

Config defines configuration for debug server.

type Panel

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

Panel implements a serving of customized callbacks.

func NewPanel

func NewPanel(log *zap.Logger, url, name string) *Panel

NewPanel creates a new panel.

func (*Panel) Add

func (panel *Panel) Add(cats ...*ButtonGroup)

Add adds a button group to the panel.

func (*Panel) ServeHTTP

func (panel *Panel) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves buttons on the prefix and on other endpoints calls the specified call.

type Server

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

Server provides endpoints for debugging.

func NewServer

func NewServer(log *zap.Logger, listener net.Listener, registry *monkit.Registry, config Config) *Server

NewServer returns a new debug.Server.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

func (server *Server) Run(ctx context.Context) error

Run starts the debug endpoint.

Jump to

Keyboard shortcuts

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