vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2018-06-17 17:59:12 +01:00
parent 3f0789e2db
commit 08021c4636
2474 changed files with 435818 additions and 282709 deletions
+14 -14
View File
@@ -27,7 +27,7 @@ import (
"google.golang.org/genproto/googleapis/type/latlng"
)
var nullValue = &pb.Value{&pb.Value_NullValue{}}
var nullValue = &pb.Value{ValueType: &pb.Value_NullValue{}}
var (
typeOfByteSlice = reflect.TypeOf([]byte{})
@@ -59,31 +59,31 @@ func toProtoValue(v reflect.Value) (pbv *pb.Value, sawServerTimestamp bool, err
}
switch x := vi.(type) {
case []byte:
return &pb.Value{&pb.Value_BytesValue{x}}, false, nil
return &pb.Value{ValueType: &pb.Value_BytesValue{x}}, false, nil
case time.Time:
ts, err := ptypes.TimestampProto(x)
if err != nil {
return nil, false, err
}
return &pb.Value{&pb.Value_TimestampValue{ts}}, false, nil
return &pb.Value{ValueType: &pb.Value_TimestampValue{ts}}, false, nil
case *ts.Timestamp:
if x == nil {
// gRPC doesn't like nil oneofs. Use NullValue.
return nullValue, false, nil
}
return &pb.Value{&pb.Value_TimestampValue{x}}, false, nil
return &pb.Value{ValueType: &pb.Value_TimestampValue{x}}, false, nil
case *latlng.LatLng:
if x == nil {
// gRPC doesn't like nil oneofs. Use NullValue.
return nullValue, false, nil
}
return &pb.Value{&pb.Value_GeoPointValue{x}}, false, nil
return &pb.Value{ValueType: &pb.Value_GeoPointValue{x}}, false, nil
case *DocumentRef:
if x == nil {
// gRPC doesn't like nil oneofs. Use NullValue.
return nullValue, false, nil
}
return &pb.Value{&pb.Value_ReferenceValue{x.Path}}, false, nil
return &pb.Value{ValueType: &pb.Value_ReferenceValue{x.Path}}, false, nil
// Do not add bool, string, int, etc. to this switch; leave them in the
// reflect-based switch below. Moving them here would drop support for
// types whose underlying types are those primitives.
@@ -92,15 +92,15 @@ func toProtoValue(v reflect.Value) (pbv *pb.Value, sawServerTimestamp bool, err
}
switch v.Kind() {
case reflect.Bool:
return &pb.Value{&pb.Value_BooleanValue{v.Bool()}}, false, nil
return &pb.Value{ValueType: &pb.Value_BooleanValue{v.Bool()}}, false, nil
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return &pb.Value{&pb.Value_IntegerValue{v.Int()}}, false, nil
return &pb.Value{ValueType: &pb.Value_IntegerValue{v.Int()}}, false, nil
case reflect.Uint8, reflect.Uint16, reflect.Uint32:
return &pb.Value{&pb.Value_IntegerValue{int64(v.Uint())}}, false, nil
return &pb.Value{ValueType: &pb.Value_IntegerValue{int64(v.Uint())}}, false, nil
case reflect.Float32, reflect.Float64:
return &pb.Value{&pb.Value_DoubleValue{v.Float()}}, false, nil
return &pb.Value{ValueType: &pb.Value_DoubleValue{v.Float()}}, false, nil
case reflect.String:
return &pb.Value{&pb.Value_StringValue{v.String()}}, false, nil
return &pb.Value{ValueType: &pb.Value_StringValue{v.String()}}, false, nil
case reflect.Slice:
return sliceToProtoValue(v)
case reflect.Map:
@@ -139,7 +139,7 @@ func sliceToProtoValue(v reflect.Value) (*pb.Value, bool, error) {
}
vals[i] = val
}
return &pb.Value{&pb.Value_ArrayValue{&pb.ArrayValue{vals}}}, false, nil
return &pb.Value{ValueType: &pb.Value_ArrayValue{&pb.ArrayValue{Values: vals}}}, false, nil
}
func mapToProtoValue(v reflect.Value) (*pb.Value, bool, error) {
@@ -175,7 +175,7 @@ func mapToProtoValue(v reflect.Value) (*pb.Value, bool, error) {
// The entire map consisted of ServerTimestamp values.
pv = nil
} else {
pv = &pb.Value{&pb.Value_MapValue{&pb.MapValue{m}}}
pv = &pb.Value{ValueType: &pb.Value_MapValue{&pb.MapValue{Fields: m}}}
}
return pv, sawServerTimestamp, nil
}
@@ -215,7 +215,7 @@ func structToProtoValue(v reflect.Value) (*pb.Value, bool, error) {
// The entire struct consisted of ServerTimestamp or omitempty values.
pv = nil
} else {
pv = &pb.Value{&pb.Value_MapValue{&pb.MapValue{m}}}
pv = &pb.Value{ValueType: &pb.Value_MapValue{&pb.MapValue{Fields: m}}}
}
return pv, sawServerTimestamp, nil
}