Documentation
¶
Index ¶
- func NewServer(conf *settingpb.Config) szhttp.Server
- func WrapHandler(next app.HandlerFunc) app.HandlerFunc
- type Context
- func (c *Context) AddResponseHeader(key, value []byte)
- func (c *Context) Body() []byte
- func (c *Context) Close() error
- func (c *Context) Context() context.Context
- func (c *Context) Copy(src io.Reader) error
- func (c *Context) File(path string) error
- func (c *Context) Flush() error
- func (c *Context) GetContext() context.Context
- func (c *Context) Header(k []byte) []byte
- func (c *Context) Headers() map[string][][]byte
- func (c *Context) Host() []byte
- func (c *Context) JA4() string
- func (c *Context) JSON(statusCode int, body []byte) error
- func (c *Context) Method() []byte
- func (c *Context) Path() []byte
- func (c *Context) Protocol() string
- func (c *Context) Queries() map[string][][]byte
- func (c *Context) Query(k []byte) []byte
- func (c *Context) QueryStr() []byte
- func (c *Context) RemoteAddr() []byte
- func (c *Context) Render(statusCode int, component templ.Component) error
- func (c *Context) RequestBodyStream() io.Reader
- func (c *Context) RequestIP() []byte
- func (c *Context) RequestTime() time.Time
- func (c *Context) ResetResponse()
- func (c *Context) ResponseBody() []byte
- func (c *Context) ResponseHeader() map[string][][]byte
- func (c *Context) Scheme() string
- func (c *Context) SetBody(body []byte)
- func (c *Context) SetHeader(key, value []byte)
- func (c *Context) SetHost(h []byte)
- func (c *Context) SetPath(path []byte)
- func (c *Context) SetQuery(key []byte, values ...[]byte)
- func (c *Context) SetResponseHeader(key, value []byte)
- func (c *Context) SetStatusCode(code int)
- func (c *Context) SetURI(u []byte)
- func (c *Context) StatusCode() int
- func (c *Context) String(statusCode int, body []byte) error
- func (c *Context) TLS() bool
- func (c *Context) URI() []byte
- func (c *Context) Unwrap() any
- func (c *Context) VisitRequestHeaders(visitor func(k []byte, v []byte))
- func (c *Context) VisitResponseHeaders(visitor func(k []byte, v []byte))
- func (c *Context) X() *edgepb.ContextExtra
- type XServer
- func (s *XServer) AcceptReverse(target string) (szhttp.ReverseProxy, error)
- func (s *XServer) Handle(fn szhttp.RequestHandler)
- func (s *XServer) ListenAndServe(addr string, opts ...szhttp.ServerOption) error
- func (s *XServer) Shutdown(ctx context.Context) error
- func (s *XServer) TLS(certFile, keyFile string, tlsConfig *tls.Config) (*tls.Config, error)
- func (s *XServer) Use(mdw ...func(handler szhttp.RequestHandler) szhttp.RequestHandler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
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 (*Context) GetContext ¶
func (*Context) RemoteAddr ¶
func (*Context) RequestBodyStream ¶
func (*Context) RequestTime ¶
func (*Context) ResetResponse ¶
func (c *Context) ResetResponse()
func (*Context) ResponseBody ¶
func (*Context) ResponseHeader ¶
func (*Context) SetResponseHeader ¶
func (*Context) SetStatusCode ¶
func (*Context) StatusCode ¶
func (*Context) VisitRequestHeaders ¶
func (*Context) VisitResponseHeaders ¶
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) Use ¶
func (s *XServer) Use( mdw ...func(handler szhttp.RequestHandler) szhttp.RequestHandler)
Use implements Server.
Click to show internal directories.
Click to hide internal directories.