mainutil

package module
v0.0.0-...-e267d3c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 14 Imported by: 1

README

NO LONGER MAINTAINED

Documentation

Overview

Package mainutil provide utility for main package.

It is not intended for usage outside main package.

Note

everything in here doesn't have stable API (can change at any time),

the main purpose of this package is utility library used by @win-t

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonHTTPMiddlware

func CommonHTTPMiddlware(printRequestLog bool) []func(http.HandlerFunc) http.HandlerFunc

CommonHTTPMiddlware .

func DefaultHTTPServer

func DefaultHTTPServer(addr string, handler http.HandlerFunc) *http.Server

DefaultHTTPServer .

func ExitOnPanic

func ExitOnPanic()

ExitOnPanic .

func HTTPSetTLS

func HTTPSetTLS(s *http.Server, certfile string, keyfile string) error

HTTPSetTLS .

func HTTPSetTLSString

func HTTPSetTLSString(s *http.Server, certpem string, keypem string) error

HTTPSetTLSString .

func ListenUnixSocket

func ListenUnixSocket(path string) (listener net.Listener, err error)

ListenUnixSocket .

func RunHTTPServerOn

func RunHTTPServerOn(
	ctx context.Context,
	s *http.Server,
	l net.Listener,
	gracefulShutdown time.Duration,
) error

RunHTTPServerOn .

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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