Versions in this module Expand all Collapse all v3 v3.0.6 Jun 20, 2026 v3.0.5 Jun 13, 2026 Changes in this version + const EventVersion + const MaxPayloadSize + const MinRead + var ErrIndexOutOfBounds = errors.New("index out of bounds") + var ErrInvalidSliceRange = errors.New("invalid slice range") + var ErrInvalidStatusCode = errors.New("invalid status code") + var ErrNilRequest = errors.New("http.Request must not be nil") + var ErrNilResponseWriter = errors.New("http.ResponseWriter must not be nil") + var ErrResponseAlreadyWritten = errors.New("response has already been written") + var ErrSliceEmpty = errors.New("slice is empty") + var ErrTooLarge = errors.New("bytes.Buffer: too large") + func CorsMiddleware(options *Cors, ctx *HttpContext, next func(error)) + func IndexByte(b []byte, c byte) int + func MiddlewareWrapper(options *Cors) func(*HttpContext, func(error)) + type Atomic struct + func (s *Atomic[TValue]) CompareAndSwap(old, new TValue) (swapped bool) + func (s *Atomic[TValue]) Load() TValue + func (s *Atomic[TValue]) Store(val TValue) + func (s *Atomic[TValue]) Swap(new TValue) (old TValue) + type Buffer struct + func NewBuffer(buf []byte) *Buffer + func NewBufferString(s string) *Buffer + func (b *Buffer) Available() int + func (b *Buffer) AvailableBuffer() []byte + func (b *Buffer) Bytes() []byte + func (b *Buffer) Cap() int + func (b *Buffer) Clone() *Buffer + func (b *Buffer) Grow(n int) + func (b *Buffer) Len() int + func (b *Buffer) Next(n int) []byte + func (b *Buffer) Peek(n int) ([]byte, error) + func (b *Buffer) Read(p []byte) (n int, err error) + func (b *Buffer) ReadByte() (byte, error) + func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) + func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) + func (b *Buffer) ReadRune() (r rune, size int, err error) + func (b *Buffer) ReadString(delim byte) (line string, err error) + func (b *Buffer) Reset() + func (b *Buffer) Seek(offset int64, whence int) (int64, error) + func (b *Buffer) Size() int64 + func (b *Buffer) String() string + func (b *Buffer) Truncate(n int) + func (b *Buffer) UnreadByte() error + func (b *Buffer) UnreadRune() error + func (b *Buffer) Write(p []byte) (n int, err error) + func (b *Buffer) WriteByte(c byte) error + func (b *Buffer) WriteRune(r rune) (n int, err error) + func (b *Buffer) WriteString(s string) (n int, err error) + func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) + type BufferInterface interface + Available func() int + AvailableBuffer func() []byte + Bytes func() []byte + Cap func() int + Clone func() BufferInterface + Grow func(int) + Len func() int + Next func(int) []byte + Peek func(int) ([]byte, error) + ReadBytes func(byte) ([]byte, error) + ReadString func(byte) (string, error) + Reset func() + Size func() int64 + Truncate func(int) + WriteRune func(rune) (int, error) + func NewBytesBuffer(buf []byte) BufferInterface + func NewBytesBufferReader(r io.Reader) (BufferInterface, error) + func NewBytesBufferString(s string) BufferInterface + func NewStringBuffer(buf []byte) BufferInterface + func NewStringBufferReader(r io.Reader) (BufferInterface, error) + func NewStringBufferString(s string) BufferInterface + type BytesBuffer struct + func (b *BytesBuffer) Clone() BufferInterface + func (b *BytesBuffer) GoString() string + 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 + func (c *Cors) IsOriginAllowed(origin string, allowedOrigin any) bool + type ErrorMessage struct + Context map[string]any + Req *HttpContext + type EventEmitter interface + AddListener func(EventName, ...EventListener) error + Clear func() + Emit func(EventName, ...any) + EventNames func() []EventName + Len func() int + ListenerCount func(EventName) int + Listeners func(EventName) []EventListener + On func(EventName, ...EventListener) error + Once func(EventName, ...EventListener) error + RemoveAllListeners func(EventName) bool + RemoveListener func(EventName, EventListener) bool + func NewEventEmitter() EventEmitter + type EventListener func(...any) + type EventName string + type Events map[EventName][]EventListener + func (e Events) CopyTo(emitter EventEmitter) + type ExtendedError struct + Data any + Message string + func NewExtendedError(message string, data any) *ExtendedError + func (e *ExtendedError) Err() error + func (e *ExtendedError) Error() string + type HttpCompression struct + Threshold int + type HttpContext struct + Cleanup Callable + IdleTimeout time.Duration + WebTransport *WebTransportConn + Websocket *WebSocketConn + func NewHttpContext(w http.ResponseWriter, r *http.Request) *HttpContext + func (c *HttpContext) Context() context.Context + func (c *HttpContext) Done() <-chan struct{} + func (c *HttpContext) Flush() + func (c *HttpContext) GetStatusCode() int + func (c *HttpContext) Headers() *ParameterBag + func (c *HttpContext) Host() string + func (c *HttpContext) IsDone() bool + func (c *HttpContext) Method() string + func (c *HttpContext) Path() string + func (c *HttpContext) PathInfo() string + func (c *HttpContext) Query() *ParameterBag + func (c *HttpContext) Request() *http.Request + func (c *HttpContext) Response() http.ResponseWriter + func (c *HttpContext) ResponseHeaders() *ParameterBag + func (c *HttpContext) Secure() bool + func (c *HttpContext) SetStatusCode(code int) error + func (c *HttpContext) UserAgent() string + func (c *HttpContext) Write(data []byte) (n int, err error) + type HttpServer struct + 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 IncomingHttpHeaders map[string]any + func (h IncomingHttpHeaders) Header() http.Header + 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) (swapped 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 None struct + func (n *None[T]) Get() T + func (n *None[T]) IsEmpty() bool + func (n *None[T]) IsPresent() bool + type Optional interface + Get func() T + IsEmpty func() bool + IsPresent func() bool + func NewNone[T any]() Optional[T] + func NewSome[T any](value T) Optional[T] + type ParameterBag struct + func NewParameterBag(parameters map[string][]string) *ParameterBag + func (p *ParameterBag) Add(key string, value string) + func (p *ParameterBag) All() map[string][]string + func (p *ParameterBag) Count() int + func (p *ParameterBag) Get(key string, _default ...string) (string, bool) + func (p *ParameterBag) GetFirst(key string, _default ...string) (string, bool) + func (p *ParameterBag) GetLast(key string, _default ...string) (string, bool) + func (p *ParameterBag) Gets(key string, _default ...[]string) ([]string, bool) + func (p *ParameterBag) Has(key string) bool + func (p *ParameterBag) Keys() []string + func (p *ParameterBag) Peek(key string, _default ...string) string + func (p *ParameterBag) Remove(key string) + func (p *ParameterBag) Replace(parameters map[string][]string) + func (p *ParameterBag) Set(key string, value string) + func (p *ParameterBag) With(parameters map[string][]string) + type ParsedUrlQuery map[string]any + func (q ParsedUrlQuery) Query() url.Values + 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[KType comparable](keys ...KType) *Set[KType] + func (s *Set[KType]) Add(keys ...KType) bool + func (s *Set[KType]) All() map[KType]Void + func (s *Set[KType]) Clear() bool + func (s *Set[KType]) Delete(keys ...KType) bool + func (s *Set[KType]) Has(key KType) bool + func (s *Set[KType]) Keys() []KType + func (s *Set[KType]) Len() int + func (s *Set[KType]) MarshalJSON() ([]byte, error) + func (s *Set[KType]) MarshalMsgpack() ([]byte, error) + func (s *Set[KType]) UnmarshalJSON(data []byte) error + func (s *Set[KType]) UnmarshalMsgpack(data []byte) error + type Slice struct + func NewSlice[T any](elements ...T) *Slice[T] + func (s *Slice[T]) All() []T + func (s *Slice[T]) AllAndClear() []T + func (s *Slice[T]) Clear() + func (s *Slice[T]) DoRead(op func([]T)) + func (s *Slice[T]) DoWrite(op func([]T) []T) + func (s *Slice[T]) Filter(condition func(T) bool) (filtered []T) + func (s *Slice[T]) FindIndex(condition func(T) bool) int + func (s *Slice[T]) Get(index int) (element T, err error) + func (s *Slice[T]) Len() int + func (s *Slice[T]) MarshalJSON() ([]byte, error) + func (s *Slice[T]) MarshalMsgpack() ([]byte, error) + func (s *Slice[T]) Pop() (element T, err error) + func (s *Slice[T]) Push(elements ...T) int + func (s *Slice[T]) Range(f func(T, int) bool, reverse ...bool) + func (s *Slice[T]) RangeAndSplice(f func(T, int) (bool, int, int, []T), reverse ...bool) ([]T, error) + func (s *Slice[T]) Remove(condition func(T) bool) + func (s *Slice[T]) RemoveAll(condition func(T) bool) + func (s *Slice[T]) Replace(elements []T) + func (s *Slice[T]) Set(index int, element T) error + func (s *Slice[T]) Shift() (element T, err error) + func (s *Slice[T]) Slice(start, end int) ([]T, error) + func (s *Slice[T]) Splice(start, deleteCount int, insert ...T) ([]T, error) + func (s *Slice[T]) UnmarshalJSON(data []byte) error + func (s *Slice[T]) UnmarshalMsgpack(data []byte) error + func (s *Slice[T]) Unshift(elements ...T) int + type Some struct + func (s *Some[T]) Get() T + func (s *Some[T]) IsEmpty() bool + func (s *Some[T]) IsPresent() bool + type StringBuffer struct + func (sb *StringBuffer) Clone() BufferInterface + func (sb *StringBuffer) GoString() string + func (sb *StringBuffer) MarshalJSON() ([]byte, error) + func (sb *StringBuffer) UnmarshalJSON(data []byte) error + type Void = struct + var NULL Void + type WebSocketConn struct + func (t *WebSocketConn) Close() error + type WebTransportConn struct + func (t *WebTransportConn) CloseWithError(code wt.SessionErrorCode, msg string) error