routing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *mux.Router

NewRouter creates the router with all API routes and the static files handler

Types

type GenericError added in v0.5.0

type GenericError struct {
	// in: body
	Body struct {
		// HTTP status code
		// example: 400
		// default: 400
		Code    int32 `json:"code"`
		Message error `json:"message"`
	} `json:"body"`
}

A GenericError is the default error message that is generated.

swagger:response genericError

type InternalError added in v0.5.0

type InternalError struct {
	// in: body
	Body struct {
		// HTTP status code
		// example: 500
		// default: 500
		Code    int32 `json:"code"`
		Message error `json:"message"`
	} `json:"body"`
}

A Internal is the error message that means something has gone wrong

swagger:response internalError

type NotFoundError added in v0.5.0

type NotFoundError struct {
	// in: body
	Body struct {
		// HTTP status code
		// example: 404
		// default: 404
		Code    int32 `json:"code"`
		Message error `json:"message"`
	} `json:"body"`
}

A NotFoundError is the error message that is generated when server could not find what was requested.

swagger:response notFoundError

type Route

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

Route describes a single route

type Routes

type Routes struct {
	Routes []Route
}

Routes holds an array of Route

func NewRoutes

func NewRoutes() (r *Routes)

NewRoutes creates and returns all the API routes

Jump to

Keyboard shortcuts

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