testutils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(filepath string) ([]byte, error)

ReadFile reads a file and returns the byte contents

Types

type MockComponent

type MockComponent struct {
	*fiber.BaseComponent
	mock.Mock
	// contains filtered or unexported fields
}

func NewMockComponent

func NewMockComponent(id string, responses ...testUtilsHttp.DelayedResponse) *MockComponent

func (*MockComponent) Dispatch

type MockRoutingStrategy

type MockRoutingStrategy struct {
	mock.Mock
	fiber.BaseFiberType
}

func NewMockRoutingStrategy

func NewMockRoutingStrategy(
	routes map[string]fiber.Component,
	order []string,
	latency time.Duration,
	err error,
) *MockRoutingStrategy

func (*MockRoutingStrategy) SelectRoute

func (s *MockRoutingStrategy) SelectRoute(
	_ context.Context,
	req fiber.Request,
	routes map[string]fiber.Component,
) (route fiber.Component, fallbacks []fiber.Component, labels fiber.Labels, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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