common

package
v0.0.0-...-44031fb Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package common contains common utilities that are shared among other packages.

Index

Constants

View Source
const ShowErrorDetailsEnv = "XRAYR_SHOW_ERROR_DETAILS"

Variables

This section is empty.

Functions

func SafeCompileRegex

func SafeCompileRegex(pattern string) (*regexp.Regexp, error)

SafeCompileRegex compiles a regex pattern with safety checks against catastrophic backtracking (ReDoS). It validates the parsed syntax tree depth and rejects overly long patterns.

func SetShowErrorDetails

func SetShowErrorDetails(enabled bool)

func ShowErrorDetails

func ShowErrorDetails() bool

Types

type ManagedPeriodic

type ManagedPeriodic struct {
	Interval time.Duration
	Execute  func() error
	// contains filtered or unexported fields
}

ManagedPeriodic runs Execute immediately on Start, then waits Interval after each successful callback, and waits for an in-flight callback when closed.

func (*ManagedPeriodic) Close

func (p *ManagedPeriodic) Close() error

func (*ManagedPeriodic) Start

func (p *ManagedPeriodic) Start() error

func (*ManagedPeriodic) Stop

func (p *ManagedPeriodic) Stop() error

func (*ManagedPeriodic) Wait

func (p *ManagedPeriodic) Wait() error

Directories

Path Synopsis
Package limiter is to control the links that go into the dispatcher
Package limiter is to control the links that go into the dispatcher
Package rule controls audit-rule matching and result draining.
Package rule controls audit-rule matching and result draining.

Jump to

Keyboard shortcuts

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