routes

package
v0.0.0-...-3295dff Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpMethod

type HttpMethod string
const (
	GET    HttpMethod = "GET"
	POST   HttpMethod = "POST"
	PUT    HttpMethod = "PUT"
	PATCH  HttpMethod = "PATCH"
	DELETE HttpMethod = "DELETE"
)

type NatsRoute

type NatsRoute struct {
	// contains filtered or unexported fields
}

Holder for a nats route's info.

func NewNatsRoute

func NewNatsRoute(pathStr string, handlerFun nats.Handler) *NatsRoute

Create a new route with it's subscription path and corresponding handler.

func (*NatsRoute) GetHandler

func (n *NatsRoute) GetHandler() nats.Handler

Get Handler func

func (*NatsRoute) GetPath

func (n *NatsRoute) GetPath() string

Get subscription path

type Route

type Route interface {
	GetPath() string
	GetHandler() interface{}
}

Base interface for generic route types.

type WebRoute

type WebRoute struct {
	// contains filtered or unexported fields
}

func NewWebRoute

func NewWebRoute(name string, pathStr string, method HttpMethod, handlerFun httprouter.Handle) *WebRoute

func (*WebRoute) GetHandler

func (n *WebRoute) GetHandler() httprouter.Handle

func (*WebRoute) GetMethod

func (n *WebRoute) GetMethod() string

func (*WebRoute) GetName

func (n *WebRoute) GetName() string

func (*WebRoute) GetPath

func (n *WebRoute) GetPath() string

Jump to

Keyboard shortcuts

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