Giter VIP home page Giter VIP logo

muxlist's Introduction

Muxlist

Build Status

It's like a route debugger for Gorilla/Mux or your favorite router.

Coming from PHP, web frameworks i use usually have a command to view the registered routes. Since i am used to that, i decided to do something for gorrila/mux since i use it quite a bit.

Muxlist

Usage

    r := mux.NewRouter()

	r.Handle("/", index).Methods("GET")

	r.HandleFunc("/logout", logout).Methods("GET")

	r.Handle("/login", login).Methods("GET", "POST")

	r.Handle("/signup", signup).Methods("GET", "POST")

	r.Handle("/recipes/create", addRecipe).Methods("GET")

	muxlist.NewMuxLister(muxlist.NewGorillaMuxLister(r)).Table()

Naturally, you should only run this in development, so you'd have something like if development { ... }

The methods for the routes are currently not available since there is still a pending PR for that in gorrila/mux. But i'd get it in as soon as it gets merged in

This currently works for gorrila/mux but could be extended to work for any other multiplexer. All that is needed is a struct that satisfies Extractor.

Extractor looks like :

type Extractor interface {
	Extract() ResultSet
	List() string
}

Then register it with

muxlist.NewMuxLister(muxlist.NewLister())
muxlist.Table()

LICENSE

MIT

muxlist's People

Watchers

Steve Newell avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.