credentialweight

package
v7.2.104 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package credentialweight defines shared credential weight validation and parsing.

Index

Constants

View Source
const (
	// Default is used when a credential does not define a weight.
	Default int64 = 1
	// Max bounds scheduler arithmetic while allowing practical proportional routing.
	Max int64 = 1_000_000
)

Variables

This section is empty.

Functions

func Normalize

func Normalize(weight int64) (int64, error)

Normalize validates and normalizes an explicit weight. Non-positive values are valid and normalize to zero, which excludes the credential from weighted routing.

func ParseString

func ParseString(raw string) (int64, error)

ParseString parses a scheduler attribute. An empty value uses the default weight.

func ParseValue

func ParseValue(value any) (int64, error)

ParseValue parses a JSON-compatible auth-file metadata value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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