Versions in this module Expand all Collapse all v2 v2.0.7 Dec 18, 2023 Changes in this version + func CorsMiddleware(options *Cors, ctx *HttpContext, next func(error)) + func MiddlewareWrapper(options *Cors) func(*HttpContext, func(error)) + type Callable func() + type CodeMessage struct + Code int + Message string + type Cors struct + AllowedHeaders any + Credentials bool + ExposedHeaders any + Headers any + MaxAge string + Methods any + OptionsSuccessStatus int + Origin any + PreflightContinue bool + type ErrorMessage struct + Context map[string]any + Req *HttpContext + type HttpCompression struct + Threshold int + type HttpContext struct + Cleanup Callable + ResponseHeaders *utils.ParameterBag + WebTransport *webtransport.Conn + Websocket *WebSocketConn + func NewHttpContext(w http.ResponseWriter, r *http.Request) *HttpContext + func (c *HttpContext) Context() context.Context + func (c *HttpContext) Done() <-chan Void + func (c *HttpContext) Flush() + func (c *HttpContext) Get(key string, _default ...string) string + func (c *HttpContext) GetHost() (string, error) + func (c *HttpContext) GetMethod() string + func (c *HttpContext) GetPathInfo() string + func (c *HttpContext) GetStatusCode() int + func (c *HttpContext) Gets(key string, _default ...[]string) []string + func (c *HttpContext) Headers() *utils.ParameterBag + func (c *HttpContext) IsDone() bool + func (c *HttpContext) Method() string + func (c *HttpContext) Path() string + func (c *HttpContext) Query() *utils.ParameterBag + func (c *HttpContext) Request() *http.Request + func (c *HttpContext) Response() http.ResponseWriter + func (c *HttpContext) Secure() bool + func (c *HttpContext) SetStatusCode(statusCode int) + func (c *HttpContext) UserAgent() string + func (c *HttpContext) Write(wb []byte) (int, error) + type HttpServer struct + func CreateServer(defaultHandler http.Handler) *HttpServer + func NewWebServer(defaultHandler http.Handler) *HttpServer + func (s *HttpServer) Close(fn func(error)) (err error) + func (s *HttpServer) Listen(addr string, fn Callable) *http.Server + func (s *HttpServer) ListenHTTP3TLS(addr string, certFile string, keyFile string, quicConfig *quic.Config, ...) *http3.Server + func (s *HttpServer) ListenTLS(addr string, certFile string, keyFile string, fn Callable) *http.Server + func (s *HttpServer) ListenWebTransportTLS(addr string, certFile string, keyFile string, quicConfig *quic.Config, ...) *webtransport.Server + type Kv struct + Key string + Value string + type Map struct + func (m *Map[TKey, TValue]) Clear() + func (m *Map[TKey, TValue]) CompareAndDelete(key TKey, old TValue) (deleted bool) + func (m *Map[TKey, TValue]) CompareAndSwap(key TKey, old TValue, new TValue) bool + func (m *Map[TKey, TValue]) Delete(key TKey) + func (m *Map[TKey, TValue]) Keys() (keys []TKey) + func (m *Map[TKey, TValue]) Len() (n int) + func (m *Map[TKey, TValue]) Load(key TKey) (value TValue, ok bool) + func (m *Map[TKey, TValue]) LoadAndDelete(key TKey) (value TValue, loaded bool) + func (m *Map[TKey, TValue]) LoadOrStore(key TKey, value TValue) (actual TValue, loaded bool) + func (m *Map[TKey, TValue]) Range(f func(key TKey, value TValue) bool) + func (m *Map[TKey, TValue]) Store(key TKey, value TValue) + func (m *Map[TKey, TValue]) Swap(key TKey, value TValue) (previous TValue, loaded bool) + func (m *Map[TKey, TValue]) Values() (values []TValue) + type PerMessageDeflate struct + Threshold int + type ServeMux struct + DefaultHandler http.Handler + func NewServeMux(defaultHandler http.Handler) *ServeMux + func (mux *ServeMux) Handle(pattern string, handler http.Handler) + func (mux *ServeMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) + func (mux *ServeMux) Handler(r *http.Request) (h http.Handler, pattern string) + func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Set struct + func NewSet[T comparable](keys ...T) *Set[T] + func (s *Set[T]) Add(keys ...T) bool + func (s *Set[T]) All() map[T]Void + func (s *Set[T]) Clear() bool + func (s *Set[T]) Delete(keys ...T) bool + func (s *Set[T]) Has(key T) bool + func (s *Set[T]) Keys() (list []T) + func (s *Set[T]) Len() int + type Void struct + var NULL Void + type WebSocketConn struct