1
0

Update module prometheus/client_golang to v1.7.0 (#589)

Update module prometheus/client_golang to v1.7.0

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/589
This commit is contained in:
renovate
2020-06-17 21:24:13 +00:00
committed by konrad
parent bf41b2ed9f
commit b7c8c1f533
140 changed files with 3267 additions and 719 deletions

View File

@ -22,8 +22,9 @@
//
// The protobuf descriptor interfaces are not meant to be implemented by
// user code since they might need to be extended in the future to support
// additions to the protobuf language. Protobuf descriptors can be constructed
// using the "google.golang.org/protobuf/reflect/protodesc" package.
// additions to the protobuf language.
// The "google.golang.org/protobuf/reflect/protodesc" package converts between
// google.protobuf.DescriptorProto messages and protobuf descriptors.
//
//
// Go Type Descriptors

View File

@ -281,11 +281,19 @@ type FieldDescriptor interface {
// It is usually the camel-cased form of the field name.
JSONName() string
// HasPresence reports whether the field distinguishes between unpopulated
// and default values.
HasPresence() bool
// IsExtension reports whether this is an extension field. If false,
// then Parent and ContainingMessage refer to the same message.
// Otherwise, ContainingMessage and Parent likely differ.
IsExtension() bool
// HasOptionalKeyword reports whether the "optional" keyword was explicitly
// specified in the source .proto file.
HasOptionalKeyword() bool
// IsWeak reports whether this is a weak field, which does not impose a
// direct dependency on the target type.
// If true, then Message returns a placeholder type.
@ -375,6 +383,11 @@ type FieldDescriptors interface {
type OneofDescriptor interface {
Descriptor
// IsSynthetic reports whether this is a synthetic oneof created to support
// proto3 optional semantics. If true, Fields contains exactly one field
// with HasOptionalKeyword specified.
IsSynthetic() bool
// Fields is a list of fields belonging to this oneof.
Fields() FieldDescriptors

View File

@ -114,8 +114,8 @@ type Message interface {
// Mutable is a mutating operation and unsafe for concurrent use.
Mutable(FieldDescriptor) Value
// NewField returns a new value for assignable to the field of a given descriptor.
// For scalars, this returns the default value.
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
NewField(FieldDescriptor) Value

View File

@ -7,7 +7,6 @@ package protoreflect
import (
"fmt"
"math"
"reflect"
)
// Value is a union where only one Go type may be set at a time.
@ -87,7 +86,7 @@ func ValueOf(v interface{}) Value {
case Message, List, Map:
return valueOfIface(v)
default:
panic(fmt.Sprintf("invalid type: %v", reflect.TypeOf(v)))
panic(fmt.Sprintf("invalid type: %T", v))
}
}
@ -197,13 +196,55 @@ func (v Value) Interface() interface{} {
}
}
func (v Value) typeName() string {
switch v.typ {
case nilType:
return "nil"
case boolType:
return "bool"
case int32Type:
return "int32"
case int64Type:
return "int64"
case uint32Type:
return "uint32"
case uint64Type:
return "uint64"
case float32Type:
return "float32"
case float64Type:
return "float64"
case stringType:
return "string"
case bytesType:
return "bytes"
case enumType:
return "enum"
default:
switch v := v.getIface().(type) {
case Message:
return "message"
case List:
return "list"
case Map:
return "map"
default:
return fmt.Sprintf("<unknown: %T>", v)
}
}
}
func (v Value) panicMessage(what string) string {
return fmt.Sprintf("type mismatch: cannot convert %v to %s", v.typeName(), what)
}
// Bool returns v as a bool and panics if the type is not a bool.
func (v Value) Bool() bool {
switch v.typ {
case boolType:
return v.num > 0
default:
panic("proto: value type mismatch")
panic(v.panicMessage("bool"))
}
}
@ -213,7 +254,7 @@ func (v Value) Int() int64 {
case int32Type, int64Type:
return int64(v.num)
default:
panic("proto: value type mismatch")
panic(v.panicMessage("int"))
}
}
@ -223,7 +264,7 @@ func (v Value) Uint() uint64 {
case uint32Type, uint64Type:
return uint64(v.num)
default:
panic("proto: value type mismatch")
panic(v.panicMessage("uint"))
}
}
@ -233,7 +274,7 @@ func (v Value) Float() float64 {
case float32Type, float64Type:
return math.Float64frombits(uint64(v.num))
default:
panic("proto: value type mismatch")
panic(v.panicMessage("float"))
}
}
@ -254,7 +295,7 @@ func (v Value) Bytes() []byte {
case bytesType:
return v.getBytes()
default:
panic("proto: value type mismatch")
panic(v.panicMessage("bytes"))
}
}
@ -264,37 +305,37 @@ func (v Value) Enum() EnumNumber {
case enumType:
return EnumNumber(v.num)
default:
panic("proto: value type mismatch")
panic(v.panicMessage("enum"))
}
}
// Message returns v as a Message and panics if the type is not a Message.
func (v Value) Message() Message {
switch v := v.getIface().(type) {
switch vi := v.getIface().(type) {
case Message:
return v
return vi
default:
panic("proto: value type mismatch")
panic(v.panicMessage("message"))
}
}
// List returns v as a List and panics if the type is not a List.
func (v Value) List() List {
switch v := v.getIface().(type) {
switch vi := v.getIface().(type) {
case List:
return v
return vi
default:
panic("proto: value type mismatch")
panic(v.panicMessage("list"))
}
}
// Map returns v as a Map and panics if the type is not a Map.
func (v Value) Map() Map {
switch v := v.getIface().(type) {
switch vi := v.getIface().(type) {
case Map:
return v
return vi
default:
panic("proto: value type mismatch")
panic(v.panicMessage("map"))
}
}
@ -303,8 +344,9 @@ func (v Value) MapKey() MapKey {
switch v.typ {
case boolType, int32Type, int64Type, uint32Type, uint64Type, stringType:
return MapKey(v)
default:
panic(v.panicMessage("map key"))
}
panic("proto: invalid map key type")
}
// MapKey is used to index maps, where the Go type of the MapKey must match