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 ¶
- func CommonHTTPMiddlware(printRequestLog bool) []func(http.HandlerFunc) http.HandlerFunc
- func DefaultHTTPServer(addr string, handler http.HandlerFunc) *http.Server
- func ExitOnPanic()
- func HTTPSetTLS(s *http.Server, certfile string, keyfile string) error
- func HTTPSetTLSString(s *http.Server, certpem string, keypem string) error
- func ListenUnixSocket(path string) (listener net.Listener, err error)
- func RunHTTPServerOn(ctx context.Context, s *http.Server, l net.Listener, ...) error
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 HTTPSetTLS ¶
HTTPSetTLS .
func HTTPSetTLSString ¶
HTTPSetTLSString .
func ListenUnixSocket ¶
ListenUnixSocket .
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.