Home / File/ hooks_test.go — fiber Source File

hooks_test.go — fiber Source File

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

File go FiberCore Routing 1 imports 27 functions 3 classes

Entity Profile

Dependency Diagram

graph LR
  2d218330_4ff5_8bbe_d9c4_174410c41dd0["hooks_test.go"]
  c0b86961_3ef1_0168_52fc_98627566ed27["bytes"]
  2d218330_4ff5_8bbe_d9c4_174410c41dd0 --> c0b86961_3ef1_0168_52fc_98627566ed27
  style 2d218330_4ff5_8bbe_d9c4_174410c41dd0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package fiber

import (
	"bytes"
	"errors"
	"os"
	"runtime"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"github.com/valyala/bytebufferpool"

	"github.com/gofiber/fiber/v3/log"
)

const testMountPath = "/api"

func testSimpleHandler(c Ctx) error {
	return c.SendString("simple")
}

func Test_Hook_OnRoute(t *testing.T) {
	t.Parallel()
	app := New()

	app.Hooks().OnRoute(func(r Route) error {
		require.Empty(t, r.Name)

		return nil
	})

	app.Get("/", testSimpleHandler).Name("x")

	subApp := New()
	subApp.Get("/test", testSimpleHandler)

	app.Use("/sub", subApp)
}

func Test_Hook_OnRoute_Mount(t *testing.T) {
	t.Parallel()
	app := New()
	subApp := New()
	app.Use("/sub", subApp)

	subApp.Hooks().OnRoute(func(r Route) error {
		require.Equal(t, "/sub/test", r.Path)

		return nil
	})

	app.Hooks().OnRoute(func(r Route) error {
		require.Equal(t, "/", r.Path)

		return nil
	})

	app.Get("/", testSimpleHandler).Name("x")
// ... (663 more lines)

Domain

Subdomains

Dependencies

  • bytes

Frequently Asked Questions

What does hooks_test.go do?
hooks_test.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Routing subdomain.
What functions are defined in hooks_test.go?
hooks_test.go defines 27 function(s): Test_Hook_OnGroup, Test_Hook_OnGroupName, Test_Hook_OnGroupName_Error, Test_Hook_OnGroup_Mount, Test_Hook_OnHook, Test_Hook_OnListen, Test_Hook_OnListenPrefork, Test_Hook_OnMount, Test_Hook_OnName, Test_Hook_OnName_Error, and 17 more.
What does hooks_test.go depend on?
hooks_test.go imports 1 module(s): bytes.
Where is hooks_test.go in the architecture?
hooks_test.go is located at hooks_test.go (domain: FiberCore, subdomain: Routing).

Analyze Your Own Codebase

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

Try Supermodel Free