httpp

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package httpp contains HTTP utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoteAddr

func RemoteAddr(ctx *gin.Context) string

RemoteAddr returns the remote address of an HTTP client, with the IP replaced by the real IP passed by any proxy in between.

Types

type WrappedServer

type WrappedServer struct {
	Network     string
	Address     string
	ReadTimeout time.Duration
	Encryption  bool
	ServerCert  string
	ServerKey   string
	Handler     http.Handler
	Parent      logger.Writer
	// contains filtered or unexported fields
}

WrappedServer is a wrapper around http.Server that provides: - net.Listener allocation and closure - TLS allocation - exit on panic - logging - server header - filtering of invalid requests

func (*WrappedServer) Close

func (s *WrappedServer) Close()

Close closes all resources and waits for all routines to return.

func (*WrappedServer) Initialize added in v1.8.0

func (s *WrappedServer) Initialize() error

Initialize initializes a WrappedServer.

Jump to

Keyboard shortcuts

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