Documentation
¶
Index ¶
- type Context
- func (ctx *Context) Abort()
- func (ctx *Context) AddHeader(key, value string)
- func (ctx *Context) Application() core.Application
- func (ctx *Context) Body() (io.ReadCloser, error)
- func (ctx *Context) ClientIP() string
- func (ctx *Context) ContentLength() int64
- func (ctx *Context) ContentType() string
- func (ctx *Context) Context() context.Context
- func (ctx *Context) Cookie(name string) (*http.Cookie, error)
- func (ctx *Context) Cookies() []*http.Cookie
- func (ctx *Context) DelHeader(key string)
- func (ctx *Context) Get(key string) (any, bool)
- func (ctx *Context) GetHeader(key string) string
- func (ctx *Context) Header(key string) string
- func (ctx *Context) HeaderValues(key string) []string
- func (ctx *Context) Headers() http.Header
- func (ctx *Context) IsAbort() bool
- func (ctx *Context) Method() string
- func (ctx *Context) Next() error
- func (ctx *Context) Path() string
- func (ctx *Context) PathValue(name string) string
- func (ctx *Context) Protocol() string
- func (ctx *Context) Queries() url.Values
- func (ctx *Context) Query(key string) string
- func (ctx *Context) QueryValues(key string) []string
- func (ctx *Context) Request() core.Request
- func (ctx *Context) Resource() string
- func (ctx *Context) Response() core.Response
- func (ctx *Context) Set(key string, value any) any
- func (ctx *Context) SetHeader(key, value string)
- func (ctx *Context) Status(code int) error
- func (ctx *Context) Use(handlers ...core.HandlerFunc)
- func (ctx *Context) Write(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) Abort ¶
func (ctx *Context) Abort()
Abort marks the context as aborted, and subsequent handlers will not be executed.
func (*Context) Application ¶
func (ctx *Context) Application() core.Application
Application returns the application instance associated with the context.
func (*Context) Body ¶
func (ctx *Context) Body() (io.ReadCloser, error)
Body returns the request body as a readable stream.
func (*Context) ContentLength ¶
ContentLength returns the length of the request body in bytes.
func (*Context) ContentType ¶
ContentType returns the Content-Type header of the request.
func (*Context) HeaderValues ¶
HeaderValues retrieves all values for a header by name from the request.
func (*Context) Protocol ¶
Protocol returns the HTTP protocol version of the request (e.g., HTTP/1.1).
func (*Context) QueryValues ¶
QueryValues retrieves all values for a query parameter by name from the request.
func (*Context) Response ¶
Response returns the wrapped Response object associated with the context.
func (*Context) Status ¶
Status sets the HTTP status code for the response and returns an error if it fails.
func (*Context) Use ¶
func (ctx *Context) Use(handlers ...core.HandlerFunc)
Use adds handlers to the context, which will be executed in the order they are added.