base_http

package
v0.0.0-...-5cd5cfe Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DefaultTopicRoute              = "/x-nitric-topic/{name}"
	DefaultScheduleRoute           = "/x-nitric-schedule/{name}"
	DefaultBucketNotificationRoute = "/x-nitric-notification/bucket/{name}"
)

Variables

This section is empty.

Functions

func HttpHeadersToMap

func HttpHeadersToMap(rh *fasthttp.RequestHeader) map[string][]string

func NewHttpGateway

func NewHttpGateway(opts *HttpGatewayOptions) (gateway.GatewayService, error)

Create new HTTP gateway

Types

type HttpGateway

type HttpGateway struct {
	gateway.UnimplementedGatewayPlugin
	// contains filtered or unexported fields
}

func (*HttpGateway) Start

func (s *HttpGateway) Start(opts *gateway.GatewayStartOpts) error

Start the HTTP server and listen for requests, then route them to the appropriate handler(s

func (*HttpGateway) Stop

func (s *HttpGateway) Stop() error

Stop the HTTP gateway server

type HttpGatewayOptions

type HttpGatewayOptions struct {
	RouteRegistrationHook RouterRegistrationCallback
}

type HttpMiddleware

type HttpMiddleware func(*fasthttp.RequestCtx, *gateway.GatewayStartOpts) bool

type RouterRegistrationCallback

type RouterRegistrationCallback func(*fasthttprouter.Router, *gateway.GatewayStartOpts)

A callback function that allows for custom routing configuration to be setup by consumer packages.

Jump to

Keyboard shortcuts

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