credentialweight

package
v8.0.78 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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