router

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package router http router library. simple fast based on net/router . Copyright (C) 2020 To All Authors. All rights reserved. Author: Ron. Date: 2020-08-08 Version: 1.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Launch added in v0.0.4

func Launch(addr string)

Launch - run http server.

func Registry

func Registry(controller Controller)

Registry -

func RegistryAction

func RegistryAction(path string, action Action)

RegistryAction -

func StaticPath

func StaticPath(path string, dir string)

StaticPath - static file.

Types

type Action

type Action func(ctx Context)

Action -

type Context

type Context interface {
	Get(string) string
	Put(string)
	Body() string
	Method() string
	Response() http.ResponseWriter
	Request() *http.Request
}

Context http context.

type Controller

type Controller interface {
	Path() string
	Execute(ctx Context)
}

Controller - Current Controller.

type H added in v0.0.4

type H map[string]interface{}

H - shutcut of map.

Jump to

Keyboard shortcuts

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