Servito: github.com/ghawk1ns/Servito Index | Files | Directories

package servito

import "github.com/ghawk1ns/Servito"

Index

Package Files

config.go routes.go servito.go

func AddInterceptor Uses

func AddInterceptor(fn RequestInterceptor)

func AddRoute Uses

func AddRoute(name string, method string, pattern string, handlerFunction http.HandlerFunc)

func LoadConfigFromFile Uses

func LoadConfigFromFile(file *os.File)

func LoadConfigFromJSON Uses

func LoadConfigFromJSON(configJSON string)

func LoadConfigFromPath Uses

func LoadConfigFromPath(configPath string)

func SetAddress Uses

func SetAddress(address string)

func SetDebug Uses

func SetDebug(debug bool)

func SetPort Uses

func SetPort(port string)

func StartServer Uses

func StartServer()

Starts a servito with the default config

type RequestInterceptor Uses

type RequestInterceptor func(http.ResponseWriter, *http.Request) bool

Intercepts all incoming requests and passes control over the user. If the request was handled, RequestInterceptor should return true. This means the request will not be routed to the original target

Directories

PathSynopsis
debugHandlers
example

Package servito imports 11 packages (graph). Updated 2019-01-06. Refresh now. Tools for package owners.