mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rebase: update kubernetes to 1.28.0 in main
updating kubernetes to 1.28.0 in the main repo. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
b2fdc269c3
commit
ff3e84ad67
205
vendor/github.com/google/cel-go/ext/README.md
generated
vendored
205
vendor/github.com/google/cel-go/ext/README.md
generated
vendored
@ -3,6 +3,30 @@
|
||||
CEL extensions are a related set of constants, functions, macros, or other
|
||||
features which may not be covered by the core CEL spec.
|
||||
|
||||
## Bindings
|
||||
|
||||
Returns a cel.EnvOption to configure support for local variable bindings
|
||||
in expressions.
|
||||
|
||||
# Cel.Bind
|
||||
|
||||
Binds a simple identifier to an initialization expression which may be used
|
||||
in a subsequenct result expression. Bindings may also be nested within each
|
||||
other.
|
||||
|
||||
cel.bind(<varName>, <initExpr>, <resultExpr>)
|
||||
|
||||
Examples:
|
||||
|
||||
cel.bind(a, 'hello',
|
||||
cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello"
|
||||
|
||||
// Avoid a list allocation within the exists comprehension.
|
||||
cel.bind(valid_values, [a, b, c],
|
||||
[d, e, f].exists(elem, elem in valid_values))
|
||||
|
||||
Local bindings are not guaranteed to be evaluated before use.
|
||||
|
||||
## Encoders
|
||||
|
||||
Encoding utilies for marshalling data into standardized representations.
|
||||
@ -31,6 +55,156 @@ Example:
|
||||
|
||||
base64.encode(b'hello') // return 'aGVsbG8='
|
||||
|
||||
## Math
|
||||
|
||||
Math helper macros and functions.
|
||||
|
||||
Note, all macros use the 'math' namespace; however, at the time of macro
|
||||
expansion the namespace looks just like any other identifier. If you are
|
||||
currently using a variable named 'math', the macro will likely work just as
|
||||
intended; however, there is some chance for collision.
|
||||
|
||||
### Math.Greatest
|
||||
|
||||
Returns the greatest valued number present in the arguments to the macro.
|
||||
|
||||
Greatest is a variable argument count macro which must take at least one
|
||||
argument. Simple numeric and list literals are supported as valid argument
|
||||
types; however, other literals will be flagged as errors during macro
|
||||
expansion. If the argument expression does not resolve to a numeric or
|
||||
list(numeric) type during type-checking, or during runtime then an error
|
||||
will be produced. If a list argument is empty, this too will produce an
|
||||
error.
|
||||
|
||||
math.greatest(<arg>, ...) -> <double|int|uint>
|
||||
|
||||
Examples:
|
||||
|
||||
math.greatest(1) // 1
|
||||
math.greatest(1u, 2u) // 2u
|
||||
math.greatest(-42.0, -21.5, -100.0) // -21.5
|
||||
math.greatest([-42.0, -21.5, -100.0]) // -21.5
|
||||
math.greatest(numbers) // numbers must be list(numeric)
|
||||
|
||||
math.greatest() // parse error
|
||||
math.greatest('string') // parse error
|
||||
math.greatest(a, b) // check-time error if a or b is non-numeric
|
||||
math.greatest(dyn('string')) // runtime error
|
||||
|
||||
### Math.Least
|
||||
|
||||
Returns the least valued number present in the arguments to the macro.
|
||||
|
||||
Least is a variable argument count macro which must take at least one
|
||||
argument. Simple numeric and list literals are supported as valid argument
|
||||
types; however, other literals will be flagged as errors during macro
|
||||
expansion. If the argument expression does not resolve to a numeric or
|
||||
list(numeric) type during type-checking, or during runtime then an error
|
||||
will be produced. If a list argument is empty, this too will produce an error.
|
||||
|
||||
math.least(<arg>, ...) -> <double|int|uint>
|
||||
|
||||
Examples:
|
||||
|
||||
math.least(1) // 1
|
||||
math.least(1u, 2u) // 1u
|
||||
math.least(-42.0, -21.5, -100.0) // -100.0
|
||||
math.least([-42.0, -21.5, -100.0]) // -100.0
|
||||
math.least(numbers) // numbers must be list(numeric)
|
||||
|
||||
math.least() // parse error
|
||||
math.least('string') // parse error
|
||||
math.least(a, b) // check-time error if a or b is non-numeric
|
||||
math.least(dyn('string')) // runtime error
|
||||
|
||||
## Protos
|
||||
|
||||
Protos configure extended macros and functions for proto manipulation.
|
||||
|
||||
Note, all macros use the 'proto' namespace; however, at the time of macro
|
||||
expansion the namespace looks just like any other identifier. If you are
|
||||
currently using a variable named 'proto', the macro will likely work just as
|
||||
you intend; however, there is some chance for collision.
|
||||
|
||||
### Protos.GetExt
|
||||
|
||||
Macro which generates a select expression that retrieves an extension field
|
||||
from the input proto2 syntax message. If the field is not set, the default
|
||||
value forthe extension field is returned according to safe-traversal semantics.
|
||||
|
||||
proto.getExt(<msg>, <fully.qualified.extension.name>) -> <field-type>
|
||||
|
||||
Example:
|
||||
|
||||
proto.getExt(msg, google.expr.proto2.test.int32_ext) // returns int value
|
||||
|
||||
### Protos.HasExt
|
||||
|
||||
Macro which generates a test-only select expression that determines whether
|
||||
an extension field is set on a proto2 syntax message.
|
||||
|
||||
proto.hasExt(<msg>, <fully.qualified.extension.name>) -> <bool>
|
||||
|
||||
Example:
|
||||
|
||||
proto.hasExt(msg, google.expr.proto2.test.int32_ext) // returns true || false
|
||||
|
||||
## Sets
|
||||
|
||||
Sets provides set relationship tests.
|
||||
|
||||
There is no set type within CEL, and while one may be introduced in the
|
||||
future, there are cases where a `list` type is known to behave like a set.
|
||||
For such cases, this library provides some basic functionality for
|
||||
determining set containment, equivalence, and intersection.
|
||||
|
||||
### Sets.Contains
|
||||
|
||||
Returns whether the first list argument contains all elements in the second
|
||||
list argument. The list may contain elements of any type and standard CEL
|
||||
equality is used to determine whether a value exists in both lists. If the
|
||||
second list is empty, the result will always return true.
|
||||
|
||||
sets.contains(list(T), list(T)) -> bool
|
||||
|
||||
Examples:
|
||||
|
||||
sets.contains([], []) // true
|
||||
sets.contains([], [1]) // false
|
||||
sets.contains([1, 2, 3, 4], [2, 3]) // true
|
||||
sets.contains([1, 2.0, 3u], [1.0, 2u, 3]) // true
|
||||
|
||||
### Sets.Equivalent
|
||||
|
||||
Returns whether the first and second list are set equivalent. Lists are set
|
||||
equivalent if for every item in the first list, there is an element in the
|
||||
second which is equal. The lists may not be of the same size as they do not
|
||||
guarantee the elements within them are unique, so size does not factor into
|
||||
the computation.
|
||||
|
||||
sets.equivalent(list(T), list(T)) -> bool
|
||||
|
||||
Examples:
|
||||
|
||||
sets.equivalent([], []) // true
|
||||
sets.equivalent([1], [1, 1]) // true
|
||||
sets.equivalent([1], [1u, 1.0]) // true
|
||||
sets.equivalent([1, 2, 3], [3u, 2.0, 1]) // true
|
||||
|
||||
### Sets.Intersects
|
||||
|
||||
Returns whether the first list has at least one element whose value is equal
|
||||
to an element in the second list. If either list is empty, the result will
|
||||
be false.
|
||||
|
||||
sets.intersects(list(T), list(T)) -> bool
|
||||
|
||||
Examples:
|
||||
|
||||
sets.intersects([1], []) // false
|
||||
sets.intersects([1], [1, 2]) // true
|
||||
sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true
|
||||
|
||||
## Strings
|
||||
|
||||
Extended functions for string manipulation. As a general note, all indices are
|
||||
@ -70,6 +244,23 @@ Examples:
|
||||
'hello mellow'.indexOf('ello', 2) // returns 7
|
||||
'hello mellow'.indexOf('ello', 20) // error
|
||||
|
||||
### Join
|
||||
|
||||
Returns a new string where the elements of string list are concatenated.
|
||||
|
||||
The function also accepts an optional separator which is placed between
|
||||
elements in the resulting string.
|
||||
|
||||
<list<string>>.join() -> <string>
|
||||
<list<string>>.join(<string>) -> <string>
|
||||
|
||||
Examples:
|
||||
|
||||
['hello', 'mellow'].join() // returns 'hellomellow'
|
||||
['hello', 'mellow'].join(' ') // returns 'hello mellow'
|
||||
[].join() // returns ''
|
||||
[].join('/') // returns ''
|
||||
|
||||
### LastIndexOf
|
||||
|
||||
Returns the integer index of the last occurrence of the search string. If the
|
||||
@ -105,6 +296,20 @@ Examples:
|
||||
'TacoCat'.lowerAscii() // returns 'tacocat'
|
||||
'TacoCÆt Xii'.lowerAscii() // returns 'tacocÆt xii'
|
||||
|
||||
### Quote
|
||||
|
||||
**Introduced in version 1**
|
||||
|
||||
Takes the given string and makes it safe to print (without any formatting due to escape sequences).
|
||||
If any invalid UTF-8 characters are encountered, they are replaced with \uFFFD.
|
||||
|
||||
strings.quote(<string>)
|
||||
|
||||
Examples:
|
||||
|
||||
strings.quote('single-quote with "double quote"') // returns '"single-quote with \"double quote\""'
|
||||
strings.quote("two escape sequences \a\n") // returns '"two escape sequences \\a\\n"'
|
||||
|
||||
### Replace
|
||||
|
||||
Returns a new string based on the target, which replaces the occurrences of a
|
||||
|
Reference in New Issue
Block a user