Help us shape the future of Go! Take the 2026 Go Developer Survey

httphz

package module
v0.0.0-...-f1f9306 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(conf *settingpb.Config) szhttp.Server

NewServer creates a new hertz server instance. It implements the platform.Server interface.

func WrapHandler

func WrapHandler(next app.HandlerFunc) app.HandlerFunc

Types

type Context

type Context struct {
	*szhttp.BaseContext
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context, c *app.RequestContext) *Context

func (*Context) AddResponseHeader

func (c *Context) AddResponseHeader(key, value []byte)

func (*Context) Body

func (c *Context) Body() []byte

func (*Context) Close

func (c *Context) Close() error

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) Copy

func (c *Context) Copy(src io.Reader) error

func (*Context) File

func (c *Context) File(path string) error

func (*Context) Flush

func (c *Context) Flush() error

func (*Context) GetContext

func (c *Context) GetContext() context.Context

func (*Context) Header

func (c *Context) Header(k []byte) []byte

func (*Context) Headers

func (c *Context) Headers() map[string][][]byte

func (*Context) Host

func (c *Context) Host() []byte

func (*Context) JA4

func (c *Context) JA4() string

func (*Context) JSON

func (c *Context) JSON(statusCode int, body []byte) error

func (*Context) Method

func (c *Context) Method() []byte

func (*Context) Path

func (c *Context) Path() []byte

func (*Context) Protocol

func (c *Context) Protocol() string

func (*Context) Queries

func (c *Context) Queries() map[string][][]byte

func (*Context) Query

func (c *Context) Query(k []byte) []byte

func (*Context) QueryStr

func (c *Context) QueryStr() []byte

func (*Context) RemoteAddr

func (c *Context) RemoteAddr() []byte

func (*Context) Render

func (c *Context) Render(statusCode int, component templ.Component) error

func (*Context) RequestBodyStream

func (c *Context) RequestBodyStream() io.Reader

func (*Context) RequestIP

func (c *Context) RequestIP() []byte

func (*Context) RequestTime

func (c *Context) RequestTime() time.Time

func (*Context) ResetResponse

func (c *Context) ResetResponse()

func (*Context) ResponseBody

func (c *Context) ResponseBody() []byte

func (*Context) ResponseHeader

func (c *Context) ResponseHeader() map[string][][]byte

func (*Context) Scheme

func (c *Context) Scheme() string

func (*Context) SetBody

func (c *Context) SetBody(body []byte)

func (*Context) SetHeader

func (c *Context) SetHeader(key, value []byte)

func (*Context) SetHost

func (c *Context) SetHost(h []byte)

func (*Context) SetPath

func (c *Context) SetPath(path []byte)

func (*Context) SetQuery

func (c *Context) SetQuery(key []byte, values ...[]byte)

func (*Context) SetResponseHeader

func (c *Context) SetResponseHeader(key, value []byte)

func (*Context) SetStatusCode

func (c *Context) SetStatusCode(code int)

func (*Context) SetURI

func (c *Context) SetURI(u []byte)

func (*Context) StatusCode

func (c *Context) StatusCode() int

func (*Context) String

func (c *Context) String(statusCode int, body []byte) error

func (*Context) TLS

func (c *Context) TLS() bool

func (*Context) URI

func (c *Context) URI() []byte

func (*Context) Unwrap

func (c *Context) Unwrap() any

func (*Context) VisitRequestHeaders

func (c *Context) VisitRequestHeaders(visitor func(k []byte, v []byte))

func (*Context) VisitResponseHeaders

func (c *Context) VisitResponseHeaders(visitor func(k []byte, v []byte))

func (*Context) X

func (c *Context) X() *edgepb.ContextExtra

X implements szhttp.Context.

type XServer

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

XServer implements the Server interface.

func (*XServer) AcceptReverse

func (s *XServer) AcceptReverse(target string) (szhttp.ReverseProxy, error)

AcceptReverse implements szhttp.Server.

func (*XServer) Handle

func (s *XServer) Handle(fn szhttp.RequestHandler)

func (*XServer) ListenAndServe

func (s *XServer) ListenAndServe(
	addr string, opts ...szhttp.ServerOption) error

ListenAndServe implements platform.Server.

func (*XServer) Shutdown

func (s *XServer) Shutdown(ctx context.Context) error

Shutdown implements platform.Server.

func (*XServer) TLS

func (s *XServer) TLS(
	certFile, keyFile string, tlsConfig *tls.Config) (*tls.Config, error)

func (*XServer) Use

func (s *XServer) Use(
	mdw ...func(handler szhttp.RequestHandler) szhttp.RequestHandler)

Use implements Server.

Directories

Path Synopsis
net
std

Jump to

Keyboard shortcuts

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