Home / File/ resp_header.go — fiber Source File

resp_header.go — fiber Source File

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

File go 1 imports

Entity Profile

Dependency Diagram

graph LR
  a265b37c_2e4e_00f9_5952_0ba5f99a6711["resp_header.go"]
  baa5866c_7884_3b82_5e75_ef5c8f224470["v2"]
  a265b37c_2e4e_00f9_5952_0ba5f99a6711 --> baa5866c_7884_3b82_5e75_ef5c8f224470
  style a265b37c_2e4e_00f9_5952_0ba5f99a6711 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package binder

import (
	"github.com/gofiber/utils/v2"
	"github.com/valyala/fasthttp"
)

// RespHeaderBinding is the respHeader binder for response header.
type RespHeaderBinding struct {
	EnableSplitting bool
}

// Name returns the binding name.
func (*RespHeaderBinding) Name() string {
	return "respHeader"
}

// Bind parses the response header and returns the result.
func (b *RespHeaderBinding) Bind(resp *fasthttp.Response, out any) error {
	data := make(map[string][]string)

	for key, val := range resp.Header.All() {
		k := utils.UnsafeString(key)
		v := utils.UnsafeString(val)
		if err := formatBindData(b.Name(), out, data, k, v, b.EnableSplitting, false); err != nil {
			return err
		}
	}

	return parse(b.Name(), out, data)
}

// Reset resets the RespHeaderBinding binder.
func (b *RespHeaderBinding) Reset() {
	b.EnableSplitting = false
}

Dependencies

  • v2

Frequently Asked Questions

What does resp_header.go do?
resp_header.go is a source file in the fiber codebase, written in go.
What does resp_header.go depend on?
resp_header.go imports 1 module(s): v2.
Where is resp_header.go in the architecture?
resp_header.go is located at binder/resp_header.go (directory: binder).

Analyze Your Own Codebase

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

Try Supermodel Free