testutil

package
v0.0.0-...-f67ec16 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockServer

type MockServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

MockServer provides a test HTTP server with various endpoints for testing

func NewMockServer

func NewMockServer() *MockServer

NewMockServer creates a new mock HTTP server for testing

func (*MockServer) GetRequestCount

func (ms *MockServer) GetRequestCount() int64

GetRequestCount returns the total number of requests received

func (*MockServer) ResetRequestCount

func (ms *MockServer) ResetRequestCount()

ResetRequestCount resets the request counter to zero

func (*MockServer) SetRateLimit

func (ms *MockServer) SetRateLimit(rps int)

SetRateLimit configures the rate limit for the rate-limited endpoint

func (*MockServer) TestEndpoints

func (ms *MockServer) TestEndpoints() []TestEndpoint

TestEndpoints returns a slice of test endpoint configurations

type TestEndpoint

type TestEndpoint struct {
	Name   string
	URL    string
	Params map[string]string
}

TestEndpoint represents a test endpoint configuration

Jump to

Keyboard shortcuts

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