Skip to content

A wrapper for golang web framework macross to use net/http/pprof easily.

License

Notifications You must be signed in to change notification settings

macross-contrib/macrof

Repository files navigation

macrof

A wrapper for golang web framework macross to use net/http/pprof easily.

install

First install macrof to your GOPATH using go get:

go get github.com/macross-contrib/macrof

Usage

package main

import (
    "github.com/insionng/macross"
    "github.com/macross-contrib/macrof"
)

func hello() macross.Handler {
	return func(self *macross.Context) error {
		return self.String("Hello, World!\n")
	}
}

func main() {
    m := macross.New()
    m.Get("/", hello())

    // automatically add routers for net/http/pprof
    // e.g. /debug/pprof, /debug/pprof/heap, etc.
    macrof.Wrapper(m)
    m.Listen(":8080")
}

Start this server, and now visit http://127.0.0.1:8080/debug/pprof/ and you'll see what you want.

About

A wrapper for golang web framework macross to use net/http/pprof easily.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages