webbase

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultFunctionAddress = ":8080"
	DefaultMetricsAddress  = ":8081"
)

Variables

View Source
var (
	FunctionName string
)

Functions

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *responseWriter

func NewRouter added in v1.0.5

func NewRouter() *mux.Router

NewRouter creates a new router with the default webbase middleware

func Serve deprecated

func Serve(name string, functionHandler http.HandlerFunc)

Serve is a helper function to start a server with a single function handler

Deprecated: Use ServeFunction instead

func ServeFunction added in v1.0.5

func ServeFunction(name string, functionHandler http.HandlerFunc, options ...serveOption)

ServeFunction starts a server with a single handler function

func ServeRouter added in v1.0.5

func ServeRouter(name string, router *mux.Router, options ...serveOption)

ServeRouter starts a server with a set of routes

func WithServiceListenAddress added in v1.2.0

func WithServiceListenAddress(address string) serveOption

WithServiceListenAddress sets the address for the service (healthcheck/metrics) listener

func WithWebListenAddress added in v1.2.0

func WithWebListenAddress(address string) serveOption

WithWebListenAddress sets the address for the web listener

Types

This section is empty.

Directories

Path Synopsis
example
multiEndpoint command
singleFunction command

Jump to

Keyboard shortcuts

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