middle

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

recover handler for phi mux

Index

Constants

This section is empty.

Variables

View Source
var (
	ProxyAddr string
	Log       zerolog.Logger
)

Functions

func ClientIP

func ClientIP(ctx *fasthttp.RequestCtx) string

func ExpvarHandler

func ExpvarHandler(ctx *fasthttp.RequestCtx)

func FastGetJson

func FastGetJson(url string, timeOut time.Duration) (*fasthttp.Response, error)

func FastGetWithSession

func FastGetWithSession(url string, timeOut time.Duration, sid string) (*fasthttp.Response, error)

func FastPostJson

func FastPostJson(url string, body []byte, timeOut time.Duration) (*fasthttp.Response, error)

func HostClient

func HostClient()

func InitExpvarServer

func InitExpvarServer()

func NewGracefulListener

func NewGracefulListener(ln net.Listener, maxWaitTime time.Duration) net.Listener

NewGracefulListener wraps the given listener into 'graceful shutdown' listener.

func PostStruct

func PostStruct(url string, body interface{}, timeOut time.Duration) (*fasthttp.Response, error)

func Recoverer

Recoverer(next phi.HandlerFunc) phi.HandlerFunc

func UploadClient

func UploadClient(uploadUri, filename, fieldname string) (string, error)

Types

type GracefulListener

type GracefulListener struct {
	// contains filtered or unexported fields
}

func (*GracefulListener) Accept

func (ln *GracefulListener) Accept() (net.Conn, error)

func (*GracefulListener) Addr

func (ln *GracefulListener) Addr() net.Addr

func (*GracefulListener) Close

func (ln *GracefulListener) Close() error

Close closes the inner listener and waits until all the pending open connections are closed before returning.

Jump to

Keyboard shortcuts

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