mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 00:06:38 +00:00
Upgrade x/sync, Prometheus client and faas-provider
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
23
gateway/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
23
gateway/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
@ -21,10 +21,11 @@ import (
|
||||
type Number int32
|
||||
|
||||
const (
|
||||
MinValidNumber Number = 1
|
||||
FirstReservedNumber Number = 19000
|
||||
LastReservedNumber Number = 19999
|
||||
MaxValidNumber Number = 1<<29 - 1
|
||||
MinValidNumber Number = 1
|
||||
FirstReservedNumber Number = 19000
|
||||
LastReservedNumber Number = 19999
|
||||
MaxValidNumber Number = 1<<29 - 1
|
||||
DefaultRecursionLimit = 10000
|
||||
)
|
||||
|
||||
// IsValid reports whether the field number is semantically valid.
|
||||
@ -55,6 +56,7 @@ const (
|
||||
errCodeOverflow
|
||||
errCodeReserved
|
||||
errCodeEndGroup
|
||||
errCodeRecursionDepth
|
||||
)
|
||||
|
||||
var (
|
||||
@ -112,6 +114,10 @@ func ConsumeField(b []byte) (Number, Type, int) {
|
||||
// When parsing a group, the length includes the end group marker and
|
||||
// the end group is verified to match the starting field number.
|
||||
func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) {
|
||||
return consumeFieldValueD(num, typ, b, DefaultRecursionLimit)
|
||||
}
|
||||
|
||||
func consumeFieldValueD(num Number, typ Type, b []byte, depth int) (n int) {
|
||||
switch typ {
|
||||
case VarintType:
|
||||
_, n = ConsumeVarint(b)
|
||||
@ -126,6 +132,9 @@ func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) {
|
||||
_, n = ConsumeBytes(b)
|
||||
return n
|
||||
case StartGroupType:
|
||||
if depth < 0 {
|
||||
return errCodeRecursionDepth
|
||||
}
|
||||
n0 := len(b)
|
||||
for {
|
||||
num2, typ2, n := ConsumeTag(b)
|
||||
@ -140,7 +149,7 @@ func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) {
|
||||
return n0 - len(b)
|
||||
}
|
||||
|
||||
n = ConsumeFieldValue(num2, typ2, b)
|
||||
n = consumeFieldValueD(num2, typ2, b, depth-1)
|
||||
if n < 0 {
|
||||
return n // forward error code
|
||||
}
|
||||
@ -507,6 +516,7 @@ func EncodeTag(num Number, typ Type) uint64 {
|
||||
}
|
||||
|
||||
// DecodeZigZag decodes a zig-zag-encoded uint64 as an int64.
|
||||
//
|
||||
// Input: {…, 5, 3, 1, 0, 2, 4, 6, …}
|
||||
// Output: {…, -3, -2, -1, 0, +1, +2, +3, …}
|
||||
func DecodeZigZag(x uint64) int64 {
|
||||
@ -514,6 +524,7 @@ func DecodeZigZag(x uint64) int64 {
|
||||
}
|
||||
|
||||
// EncodeZigZag encodes an int64 as a zig-zag-encoded uint64.
|
||||
//
|
||||
// Input: {…, -3, -2, -1, 0, +1, +2, +3, …}
|
||||
// Output: {…, 5, 3, 1, 0, 2, 4, 6, …}
|
||||
func EncodeZigZag(x int64) uint64 {
|
||||
@ -521,6 +532,7 @@ func EncodeZigZag(x int64) uint64 {
|
||||
}
|
||||
|
||||
// DecodeBool decodes a uint64 as a bool.
|
||||
//
|
||||
// Input: { 0, 1, 2, …}
|
||||
// Output: {false, true, true, …}
|
||||
func DecodeBool(x uint64) bool {
|
||||
@ -528,6 +540,7 @@ func DecodeBool(x uint64) bool {
|
||||
}
|
||||
|
||||
// EncodeBool encodes a bool as a uint64.
|
||||
//
|
||||
// Input: {false, true}
|
||||
// Output: { 0, 1}
|
||||
func EncodeBool(x bool) uint64 {
|
||||
|
Reference in New Issue
Block a user