stdrouter

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 1 Imported by: 0

README

stdrouter (Standard Library Router Generator)

Router

MIT License

Introduction

stdrouter generates http router that can handle path parameter written only with Go standard library.

Features

  • No external library (only go standard library)
  • Simple implementation
  • Easy to use middleware

Usage

  1. Create routing configuration file as router.go
  2. Run stdrouter in the same directory as router.go
  3. router_gen.go will be created. This is the implementation of router.

See example for detail.

Installation

$ go get -u github.com/tetsuzawa/stdrouter/cmd/stdrouter

License

MIT License

Copyright (c) 2020-present, Tetsu Takizawa and Contributors.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct{}

func NewRouter

func NewRouter() Router

func (Router) HandleFunc

func (router Router) HandleFunc(path interface{}, method interface{}, handlerFunc interface{})

func (Router) HandleMethodNotAllowed

func (router Router) HandleMethodNotAllowed(handlerFunc interface{})

func (Router) HandleNotFound

func (router Router) HandleNotFound(handlerFunc interface{})

func (Router) ServeHTTP

func (router Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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