http

package
v0.0.0-...-7a3fa1c Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserIP

func UserIP(r *http.Request) (string, string, error)

UserIP returns the IP address of the user from the request.

Types

type Interface

type Interface interface {
	ListenAndServe() error
	ListenAndServeTLS(certFile string, keyFile string) error
	Shutdown(ctx context.Context) error
}

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler http.Handler, useSSL bool, host string, useStaging bool) *Server

NewServer creates a new Server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts a https server.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server without interrupting any active connections.

func (*Server) String

func (s *Server) String() string

String is the string representation of the server.

Jump to

Keyboard shortcuts

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