httpp

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package httpp contains HTTP utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseContentType added in v1.8.1

func ParseContentType(v string) string

ParseContentType parses a Content-Type header and returns the content type.

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 Server added in v1.9.3

type Server 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
}

Server 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 (*Server) Close added in v1.9.3

func (s *Server) Close()

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

func (*Server) Initialize added in v1.9.3

func (s *Server) Initialize() error

Initialize initializes a Server.

Jump to

Keyboard shortcuts

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