route

package
v0.0.0-...-9d64b15 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToHandlerFunc

func ConvertToHandlerFunc(process func(r *http.Request) (body interface{}, error *HttpServerError)) func(w http.ResponseWriter, r *http.Request)

Types

type DefaultRoute

type DefaultRoute interface {
	Process(w http.ResponseWriter, r *http.Request)
}

type HttpServerError

type HttpServerError struct {
	Code  int
	Error error
}

type NamespaceRoute

type NamespaceRoute struct {
	Namespace string

	Routes     []Route
	RestRoutes []RestRoute
}

type RestRoute

type RestRoute interface {
	Methods() []string
	Path() string
	Process(r *http.Request) (body interface{}, error *HttpServerError)
}

type Route

type Route interface {
	Methods() []string
	Path() string
	Process(w http.ResponseWriter, r *http.Request)
}

Jump to

Keyboard shortcuts

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