server

package
v0.0.0-...-b820d62 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(producer *kafka.DefaultProducer, auth string, allowedIPs *zbxnet.AllowedPeers) http.Handler

NewRouter creates a mux http handler with all the routing handled.

func Run

func Run(server *http.Server, cert, key string, tls bool, errors chan<- error)

Run starts the server.

func ServerInit

func ServerInit(port string, router http.Handler, timeout int) *http.Server

ServerInit initializes a http server with provided parameters.

Types

type BufferedResponseWriter

type BufferedResponseWriter struct {
	// contains filtered or unexported fields
}

BufferedResponseWriter response writer for http handler.

func (*BufferedResponseWriter) Header

func (b *BufferedResponseWriter) Header() http.Header

Header returns set headers.

func (*BufferedResponseWriter) Write

func (b *BufferedResponseWriter) Write(data []byte) (int, error)

Write writes data into buffer.

func (*BufferedResponseWriter) WriteHeader

func (b *BufferedResponseWriter) WriteHeader(code int)

WriteHeader sets code for response.

func (*BufferedResponseWriter) WriteResponse

func (b *BufferedResponseWriter) WriteResponse()

WriteResponse writes response as a json encoded text.

Jump to

Keyboard shortcuts

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