ghttputil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Die

func Die(w io.Writer, data ...interface{})

func JustDie

func JustDie()

func JustStop

func JustStop()

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) http.ResponseWriter

func StatusCode

func StatusCode(w http.ResponseWriter) (code int)

func Stop

func Stop(w io.Writer, data ...interface{})

func StopE

func StopE(err interface{}, fn ...func())

StopE will exit controller method if error is not nil. First argument is an error. Secondary argument is fail function, it be called if error is not nil. Third argument is success function, it be called if error is nil.

func Write

func Write(w io.Writer, data ...interface{}) (n int, err error)

func WriteCount

func WriteCount(w http.ResponseWriter) int64

func WritePretty

func WritePretty(w io.Writer, data ...interface{}) (n int, err error)

Types

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*ResponseWriter) ClearData

func (this *ResponseWriter) ClearData()

func (*ResponseWriter) Data

func (this *ResponseWriter) Data(k interface{}) interface{}

func (*ResponseWriter) Hijack

func (this *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*ResponseWriter) SetData

func (this *ResponseWriter) SetData(k interface{}, v interface{})

func (*ResponseWriter) StatusCode

func (this *ResponseWriter) StatusCode() int

func (*ResponseWriter) Write

func (this *ResponseWriter) Write(b []byte) (n int, err error)

func (*ResponseWriter) WriteCount

func (this *ResponseWriter) WriteCount() int64

WriteCount acquires outgoing bytes count by writer

func (*ResponseWriter) WriteHeader

func (this *ResponseWriter) WriteHeader(status int)

Jump to

Keyboard shortcuts

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