pkg

package
v0.0.0-...-38f6ed0 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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvVariableNotSetError = errors.New("environment variable is not set")
	EmptyConfigValueError  = errors.New("config value is empty")
)

Functions

func NewEmptyConfigValueError

func NewEmptyConfigValueError(configValueName string) error

func NewEnvVariableNotSetError

func NewEnvVariableNotSetError(varName string) error

func NewLogger

func NewLogger(component string) *slog.Logger

func RunClient

func RunClient(cfg *ClientConfig) error

func RunExternalTarget

func RunExternalTarget(cfg *ExternalTargetConfig) error

Types

type ClientConfig

type ClientConfig struct {
	ExternalTargetAddr string
	Interval           time.Duration
	TestTimeout        time.Duration
	Stress             bool
	StressDelay        time.Duration
}

type ExternalTargetConfig

type ExternalTargetConfig struct {
	AllowedCIDRString string
	ListenPort        int
	KeepOpen          bool
}

type LogLimiter

type LogLimiter[K comparable] struct {
	// contains filtered or unexported fields
}

func NewLogLimiter

func NewLogLimiter[K comparable]() *LogLimiter[K]

func (*LogLimiter[K]) CanLog

func (ll *LogLimiter[K]) CanLog(key K) (cnt uint64, can bool)

type Result

type Result struct {
	ClientID          string  `json:"client-id"`
	MasqueradeDelay   float64 `json:"masquerade-delay"`
	NumFailedRequests int     `json:"num-failed-requests"`
}

func (Result) LogValue

func (r Result) LogValue() slog.Value

Jump to

Keyboard shortcuts

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