mainutil

package module
Version: v0.0.0-...-5284263 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 14 Imported by: 1

README

see https://godoc.org/github.com/payfazz/mainutil

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL