Home / File/ ctx.go — fiber Source File

ctx.go — fiber Source File

Architecture documentation for ctx.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go FiberCore Context 1 imports 1 functions 3 classes

Entity Profile

Dependency Diagram

graph LR
  cad7e9fd_e7ea_d2d5_dcdb_0dc8cb836c4d["ctx.go"]
  cc7104af_aece_1fe5_3985_791c7f34910c["context"]
  cad7e9fd_e7ea_d2d5_dcdb_0dc8cb836c4d --> cc7104af_aece_1fe5_3985_791c7f34910c
  style cad7e9fd_e7ea_d2d5_dcdb_0dc8cb836c4d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
// 🤖 GitHub Repository: https://github.com/gofiber/fiber
// 📌 API Documentation: https://docs.gofiber.io

package fiber

import (
	"context"
	"crypto/tls"
	"fmt"
	"io"
	"maps"
	"mime/multipart"
	"strconv"
	"strings"
	"sync/atomic"
	"time"

	"github.com/gofiber/utils/v2"
	"github.com/valyala/bytebufferpool"
	"github.com/valyala/fasthttp"
)

const (
	schemeHTTP  = "http"
	schemeHTTPS = "https"
)

const (
	// maxParams defines the maximum number of parameters per route.
	maxParams         = 30
	maxDetectionPaths = 3
)

var (
	_ io.Writer       = (*DefaultCtx)(nil) // Compile-time check
	_ context.Context = (*DefaultCtx)(nil) // Compile-time check
)

// The contextKey type is unexported to prevent collisions with context keys defined in
// other packages.
type contextKey int

// userContextKey define the key name for storing context.Context in *fasthttp.RequestCtx
const (
	userContextKey contextKey = iota // __local_user_context__
)

// DefaultCtx is the default implementation of the Ctx interface
// generation tool `go install github.com/vburenin/ifacemaker@f30b6f9bdbed4b5c4804ec9ba4a04a999525c202`
// https://github.com/vburenin/ifacemaker/blob/f30b6f9bdbed4b5c4804ec9ba4a04a999525c202/ifacemaker.go#L14-L31
//
//go:generate ifacemaker --file ctx.go --file req.go --file res.go --struct DefaultCtx --iface Ctx --pkg fiber --promoted --output ctx_interface_gen.go --not-exported true --iface-comment "Ctx represents the Context which hold the HTTP request and response.\nIt has methods for the request query string, parameters, body, HTTP headers and so on."
type DefaultCtx struct {
	handlerCtx       CustomCtx            // Active custom context implementation, if any
	DefaultReq                            // Default request api
	DefaultRes                            // Default response api
	app              *App                 // Reference to *App
	route            *Route               // Reference to *Route
	fasthttp         *fasthttp.RequestCtx // Reference to *fasthttp.RequestCtx
// ... (765 more lines)

Domain

Subdomains

Dependencies

  • context

Frequently Asked Questions

What does ctx.go do?
ctx.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Context subdomain.
What functions are defined in ctx.go?
ctx.go defines 1 function(s): hasTransferEncodingBody.
What does ctx.go depend on?
ctx.go imports 1 module(s): context.
Where is ctx.go in the architecture?
ctx.go is located at ctx.go (domain: FiberCore, subdomain: Context).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free