server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// Service is VEAP service provider for processing the requests.
	veap.Service

	// URLPrefix must be set, if the VEAP tree starts not at root.
	URLPrefix string

	// RequestSizeLimit is the maximum size of a valid request. If not set, the
	// limit is 1 MB.
	RequestSizeLimit int64

	// HistorySizeLimit is the maximum number of entries in a history. If not
	// set, the limit is 10000 entries.
	HistorySizeLimit int64

	// Statistics collects statistics about the requests and responses.
	Stats HandlerStats
}

Handler transforms HTTP requests to VEAP service requests.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(respWriter http.ResponseWriter, request *http.Request)

type HandlerStats

type HandlerStats struct {
	Requests       uint64
	RequestBytes   uint64
	ResponseBytes  uint64
	ErrorResponses uint64
}

HandlerStats collects statistics about the requests and responses. To access the counters atomic.LoadInt64 must be used.

Jump to

Keyboard shortcuts

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