THz

package module
v0.0.0-...-27684a5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 17 Imported by: 0

README

THz Tera Hertz

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding interface {
	Bind(*Context, any) error
}

type Context

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

func (*Context) Abort

func (c *Context) Abort() *Context

func (*Context) Bind

func (c *Context) Bind(data any) error

func (*Context) BindAll

func (c *Context) BindAll(data any) error

func (*Context) BindForm

func (c *Context) BindForm(data any) error

func (*Context) BindHeader

func (c *Context) BindHeader(data any) error

func (*Context) BindJSON

func (c *Context) BindJSON(data any) error

func (*Context) BindPostForm

func (c *Context) BindPostForm(data any) error

func (*Context) BindURLQuery

func (c *Context) BindURLQuery(data any) error

func (*Context) Data

func (c *Context) Data(data render.Data)

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

func (*Context) Err

func (c *Context) Err() error

func (*Context) FC

func (c *Context) FC() *fasthttp.RequestCtx

func (*Context) Get

func (c *Context) Get(key any) (value any, exists bool)

func (*Context) Header

func (c *Context) Header(s string) []byte

func (*Context) IsDelete

func (c *Context) IsDelete() bool

func (*Context) IsGet

func (c *Context) IsGet() bool

func (*Context) IsHead

func (c *Context) IsHead() bool

func (*Context) IsOptions

func (c *Context) IsOptions() bool

func (*Context) IsPatch

func (c *Context) IsPatch() bool

func (*Context) IsPost

func (c *Context) IsPost() bool

func (*Context) IsPut

func (c *Context) IsPut() bool

func (*Context) JSON

func (c *Context) JSON(data any)

func (*Context) L

func (c *Context) L() *zap.Logger

func (*Context) Next

func (c *Context) Next()

func (*Context) Param

func (c *Context) Param(key string) string

func (*Context) Reader

func (c *Context) Reader(data render.Reader)

func (*Context) RemoteIP

func (c *Context) RemoteIP() string

func (*Context) RemoteIPs

func (c *Context) RemoteIPs() []string

func (*Context) Render

func (c *Context) Render(r render.Render)

func (*Context) Set

func (c *Context) Set(key, val any)

func (*Context) SetContentType

func (c *Context) SetContentType(v string) *Context

func (*Context) SetHeader

func (c *Context) SetHeader(k, v string) *Context

func (*Context) SetLocation

func (c *Context) SetLocation(v string) *Context

func (*Context) Status

func (c *Context) Status(code int) *Context

func (*Context) Text

func (c *Context) Text(fmt string, arg ...any)

func (*Context) Value

func (c *Context) Value(key any) any

type Handler

type Handler func(ctx *Context)

type Handlers

type Handlers []Handler

type Store

type Store[K, V any] struct {
	// contains filtered or unexported fields
}

func GetStore

func GetStore[K, V any](c *Context) Store[K, V]

func (Store[K, V]) Get

func (s Store[K, V]) Get(key K) V

func (Store[K, V]) Set

func (s Store[K, V]) Set(k K, v V)

type THz

type THz struct {
	httprouter.IRouter[Context]
	// contains filtered or unexported fields
}

func New

func New() *THz

func (*THz) AddIntercept

func (thz *THz) AddIntercept(intercept ...Handler)

func (*THz) ListenAndServe

func (thz *THz) ListenAndServe(addr string) error

func (*THz) NoRoute

func (thz *THz) NoRoute(handlers ...Handler)

func (*THz) Run

func (thz *THz) Run(ln net.Listener) error

func (*THz) RunTLS

func (thz *THz) RunTLS(ln net.Listener, cert, key string) error

func (*THz) SetConcurrency

func (thz *THz) SetConcurrency(n int) *THz

func (*THz) SetIdleTimeout

func (thz *THz) SetIdleTimeout(n time.Duration) *THz

func (*THz) SetKeepalivePeriod

func (thz *THz) SetKeepalivePeriod(n time.Duration) *THz

func (*THz) SetLog

func (thz *THz) SetLog(log *zap.Logger)

func (*THz) SetMaxRequestBodySize

func (thz *THz) SetMaxRequestBodySize(n int) *THz

func (*THz) SetReadBufferSize

func (thz *THz) SetReadBufferSize(n int) *THz

func (*THz) SetReadTimeout

func (thz *THz) SetReadTimeout(n time.Duration) *THz

func (*THz) SetReduceMemoryUsage

func (thz *THz) SetReduceMemoryUsage(n bool) *THz

func (*THz) SetTrustedHeaders

func (thz *THz) SetTrustedHeaders(header ...string)

SetTrustedHeaders

E.g: - CF-Connecting-IP - X-Forwarded-For - X-Real-IP

Remember, order determines priority

func (*THz) SetTrustedProxies

func (thz *THz) SetTrustedProxies(ip ...string) error

func (*THz) SetWriteBufferSize

func (thz *THz) SetWriteBufferSize(n int) *THz

func (*THz) SetWriteTimeout

func (thz *THz) SetWriteTimeout(n time.Duration) *THz

func (*THz) SetZapLog

func (thz *THz) SetZapLog(level zapcore.Level)

func (*THz) Stop

func (thz *THz) Stop() error

func (*THz) TestHandler

func (thz *THz) TestHandler(c *fasthttp.RequestCtx)

Directories

Path Synopsis
example
internal
middleware

Jump to

Keyboard shortcuts

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