router

package module
v0.0.0-...-680727c Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 3 Imported by: 0

README

Golang Lambda Router

Example of request routing for Golang on Lambda

Goals
  • Write something specifically for Lambda
    • Small collection of routes
    • No need for caching routes since the lambda will not live long
  • Applications should look like libraries, be thoroughly testable without http
Prior Art

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	Pattern string
	Handler func(Request, map[string]string) (Response, error)
}

type Router

type Router struct {
	GETs    []Route
	POSTs   []Route
	DELETEs []Route
}

func (*Router) DELETE

func (r *Router) DELETE(path string, f func(Request, map[string]string) (Response, error))

func (*Router) DelegateRequest

func (r *Router) DelegateRequest(request Request) (Response, error)

func (*Router) GET

func (r *Router) GET(path string, f func(Request, map[string]string) (Response, error))

func (*Router) POST

func (r *Router) POST(path string, f func(Request, map[string]string) (Response, error))

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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