Help us shape the future of Go! Take the 2026 Go Developer Survey

validation

package
v3.7.8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrQueryTooLong is used in chunk store, querier and query frontend.
	ErrQueryTooLong = "the query time range exceeds the limit (query length: %s, limit: %s)"

	ErrQueryTooOld = "this data is no longer available, it is past now - max_query_lookback (%s)"
)

Variables

This section is empty.

Functions

func IntersectionPerTenant added in v3.3.0

func IntersectionPerTenant(tenantIDs []string, f func(string) []string) []string

IntersectionPerTenant is returning the intersection of feature flags. This is useful to determine the minimal feature set supported.

func MaxDurationOrZeroPerTenant

func MaxDurationOrZeroPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

MaxDurationOrZeroPerTenant is returning the maximum duration per tenant or zero if one tenant has time.Duration(0).

func MaxDurationPerTenant

func MaxDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

MaxDurationPerTenant is returning the maximum duration per tenant. Without tenants given it will return a time.Duration(0).

func SmallestPositiveIntPerTenant

func SmallestPositiveIntPerTenant(tenantIDs []string, f func(string) int) int

SmallestPositiveIntPerTenant is returning the minimal positive value of the supplied limit function for all given tenants.

func SmallestPositiveNonZeroDurationPerTenant

func SmallestPositiveNonZeroDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

SmallestPositiveNonZeroDurationPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.

func SmallestPositiveNonZeroIntPerTenant

func SmallestPositiveNonZeroIntPerTenant(tenantIDs []string, f func(string) int) int

SmallestPositiveNonZeroIntPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.

Types

type BlockedQuery

type BlockedQuery struct {
	Pattern string                 `yaml:"pattern"`
	Regex   bool                   `yaml:"regex"`
	Hash    uint32                 `yaml:"hash"`
	Types   flagext.StringSliceCSV `yaml:"types"`
	// Tags defines a set of key=value constraints that must all match the
	// incoming request tags (from X-Query-Tags) for this rule to apply.
	// Keys are case-insensitive; values are matched case-insensitively.
	Tags map[string]string `yaml:"query_tags"`
}

type NotificationRateLimitMap

type NotificationRateLimitMap map[string]float64

func (NotificationRateLimitMap) MarshalYAML

func (m NotificationRateLimitMap) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (NotificationRateLimitMap) Set

Set implements flag.Value

func (NotificationRateLimitMap) String

func (m NotificationRateLimitMap) String() string

String implements flag.Value

func (NotificationRateLimitMap) UnmarshalYAML

func (m NotificationRateLimitMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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