gouter

package module
v0.0.0-...-151e4ca Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 6 Imported by: 0

README

gouter

gouter is simple golang routing library

Requirement

Go 1.8

Installation

go get github.com/kpango/gouter

Example

	route := gouter.New().
		AddRoute("index", "/", http.MethodGet, handler.Index).
		AddRoute("protogen", "/proto", http.MethodPost, handler.ProtoGen).
		GetRouter()

	http.ListenAndServe("port", route)

Contribution

  1. Fork it ( https://github.com/kpango/gouter/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

kpango

LICENSE

gouter released under MIT license, refer LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *gouter

Types

type Path

type Path struct {
	Value  string
	Parent *Path
	Child  map[string]*Path
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route structor

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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