debug

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

README

init debug server with custom setting

package main

import (
	"time"

	"github.com/deweppro/go-http/v2/servers/debug"
	"github.com/deweppro/go-http/v2/servers/http"
	"github.com/deweppro/go-logger"
)

func main() {
	dbg := debug.NewCustom(http.ConfigItem{Addr: "localhost:8090"}, logger.Default())
	if err := dbg.Up(); err != nil {
		panic(err)
	}

	<-time.After(time.Minute)

	if err := dbg.Down(); err != nil {
		panic(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug http.ConfigItem `yaml:"debug" json:"debug"`
}

DebugConfig ...

type Debug

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

func New

func New(conf *Config, log logger.Logger) *Debug

func NewCustom

func NewCustom(conf http.ConfigItem, log logger.Logger) *Debug

func (*Debug) Down

func (d *Debug) Down() error

func (*Debug) ServeHTTP

func (d *Debug) ServeHTTP(w http2.ResponseWriter, r *http2.Request)

func (*Debug) Up

func (d *Debug) Up() error

Jump to

Keyboard shortcuts

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