kubernetes/vendor/github.com/google/cel-go/ext/formatting.go

type clauseImpl

func clauseForType(argType ref.Type) (clauseImpl, error) {}

func formatList(arg ref.Val, locale string) (string, error) {}

func formatMap(arg ref.Val, locale string) (string, error) {}

// quoteForCEL takes a formatted, unquoted value and quotes it in a manner suitable
// for embedding directly in CEL.
func quoteForCEL(refVal ref.Val, unquotedValue string) string {}

// FormatString returns the string representation of a CEL value.
//
// It is used to implement the %s specifier in the (string).format() extension function.
func FormatString(arg ref.Val, locale string) (string, error) {}

func formatDecimal(arg ref.Val, locale string) (string, error) {}

func matchLanguage(locale string) (language.Tag, error) {}

func makeMatcher(locale string) (language.Matcher, error) {}

type stringFormatter

func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {}

func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {}

func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {}

func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {}

type stringFormatValidator

// Name returns the name of the validator.
func (stringFormatValidator) Name() string {}

// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
// during homogeneous aggregate literal type-checks.
func (stringFormatValidator) Configure(config cel.MutableValidatorConfig) error {}

// Validate parses all literal format strings and type checks the format clause against the argument
// at the corresponding ordinal within the list literal argument to the function, if one is specified.
func (stringFormatValidator) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) {}

// getErrorExprID determines which list literal argument triggered a type-disagreement for the
// purposes of more accurate error message reports.
func getErrorExprID(id int64, err error) int64 {}

// matchConstantFormatStringWithListLiteralArgs matches all valid expression nodes for string
// format checking.
func matchConstantFormatStringWithListLiteralArgs(a *ast.AST) ast.ExprMatcher {}

type stringFormatChecker

func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {}

func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {}

func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {}

func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) {}

func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) {}

func (c *stringFormatChecker) Size() int64 {}

func (c *stringFormatChecker) typeOf(id int64) *cel.Type {}

func (c *stringFormatChecker) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool {}

func (c *stringFormatChecker) verifyString(sub ast.Expr) (bool, int64) {}

func binaryFormatError(id int64, badType string) error {}

func decimalFormatError(id int64, badType string) error {}

func fixedPointFormatError(id int64, badType string) error {}

func hexFormatError(id int64, badType string) error {}

func octalFormatError(id int64, badType string) error {}

func scientificFormatError(id int64, badType string) error {}

func stringFormatError(id int64, badType string) error {}

type formatError

func newFormatError(id int64, msg string, args ...any) error {}

func (e formatError) Error() string {}

func (e formatError) Is(target error) bool {}

type stringArgList

func (c *stringArgList) Arg(index int64) (ref.Val, error) {}

func (c *stringArgList) Size() int64 {}

type formatStringInterpolator

type formatListArgs

// parseFormatString formats a string according to the string.format syntax, taking the clause implementations
// from the provided FormatCallback and the args from the given FormatList.
func parseFormatString(formatStr string, callback formatStringInterpolator, list formatListArgs, locale string) (string, error) {}

// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
// how many characters were consumed and the substituted string form of val, or an error if one occurred.
func parseAndFormatClause(formatStr string, val ref.Val, callback formatStringInterpolator, list formatListArgs, locale string) (int, string, error) {}

func parseFormattingClause(formatStr string, callback formatStringInterpolator) (int, clauseImpl, error) {}

func parsePrecision(formatStr string) (int, *int, error) {}

func isASCIIDigit(r rune) bool {}

type parseFormatError

func newParseFormatError(msg string, wrapped error) error {}

func (e parseFormatError) Error() string {}

func (e parseFormatError) Is(target error) bool {}

func (e parseFormatError) Unwrap() error {}

const runtimeID