Documentation ¶
Index ¶
- func HandleError(w http.ResponseWriter, r *http.Request, errMsg string, printLogs bool)
- func HandleGRPCError(w http.ResponseWriter, ct, errMsg string)
- func HandleHTTPError(w http.ResponseWriter, errMsg string)
- func Handler(config *config.ProxyConfig, cli *http.Client) http.HandlerFunc
- func NewCustomeRsWriter() http.ResponseWriter
- func NewProxyFromFile(file string) (*config.ProxyConfig, error)
- func NewProxyGRPC(host string, port string) *config.ProxyConfig
- func PrintLog(t time.Time, reqSize int, resSize int, r *http.Request, compact bool)
- type CustomResponseWriter
- type FakeReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
HandleError ...
func HandleGRPCError ¶
func HandleGRPCError(w http.ResponseWriter, ct, errMsg string)
HandleGRPCError ...
func HandleHTTPError ¶
func HandleHTTPError(w http.ResponseWriter, errMsg string)
HandleHTTPError ...
func Handler ¶
func Handler(config *config.ProxyConfig, cli *http.Client) http.HandlerFunc
Handler handles the proxy requests
func NewProxyFromFile ¶
func NewProxyFromFile(file string) (*config.ProxyConfig, error)
NewProxyFromFile ...
func NewProxyGRPC ¶
func NewProxyGRPC(host string, port string) *config.ProxyConfig
NewProxyGRPC ...
Types ¶
type CustomResponseWriter ¶
CustomResponseWriter implements http.ResponseWriter
func (*CustomResponseWriter) Header ¶
func (w *CustomResponseWriter) Header() http.Header
Header ...
func (*CustomResponseWriter) Write ¶
func (w *CustomResponseWriter) Write(b []byte) (int, error)
Write ...
func (*CustomResponseWriter) WriteHeader ¶
func (w *CustomResponseWriter) WriteHeader(s int)
WriteHeader ...
type FakeReader ¶
type FakeReader struct{}
FakeReader feake reader implements the io.Reader and io.ReadCloser
Click to show internal directories.
Click to hide internal directories.