summaryrefslogtreecommitdiff
path: root/vendor/github.com/gogo/protobuf/gogoproto/helper.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-26 18:26:55 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-27 18:09:12 +0000
commitaf64e10400f8533a0c48ecdf5ab9b7fbf329e14e (patch)
tree59160e3841b440dd35189c724bbb4375a7be173b /vendor/github.com/gogo/protobuf/gogoproto/helper.go
parent26d7e3c7b85e28c4e42998c90fdcc14079f13eef (diff)
downloadpodman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.gz
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.bz2
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.zip
Vendor in lots of kubernetes stuff to shrink image size
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #554 Approved by: mheon
Diffstat (limited to 'vendor/github.com/gogo/protobuf/gogoproto/helper.go')
-rw-r--r--vendor/github.com/gogo/protobuf/gogoproto/helper.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/helper.go b/vendor/github.com/gogo/protobuf/gogoproto/helper.go
index 670021fed..6b851c562 100644
--- a/vendor/github.com/gogo/protobuf/gogoproto/helper.go
+++ b/vendor/github.com/gogo/protobuf/gogoproto/helper.go
@@ -39,6 +39,14 @@ func IsNullable(field *google_protobuf.FieldDescriptorProto) bool {
return proto.GetBoolExtension(field.Options, E_Nullable, true)
}
+func IsStdTime(field *google_protobuf.FieldDescriptorProto) bool {
+ return proto.GetBoolExtension(field.Options, E_Stdtime, false)
+}
+
+func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool {
+ return proto.GetBoolExtension(field.Options, E_Stdduration, false)
+}
+
func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool {
nullable := IsNullable(field)
if field.IsMessage() || IsCustomType(field) {
@@ -82,7 +90,18 @@ func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool {
return false
}
+func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
+ return proto.GetBoolExtension(enum.Options, E_Enumdecl, proto.GetBoolExtension(file.Options, E_EnumdeclAll, true))
+}
+
+func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
+ return proto.GetBoolExtension(message.Options, E_Typedecl, proto.GetBoolExtension(file.Options, E_TypedeclAll, true))
+}
+
func GetCustomType(field *google_protobuf.FieldDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Customtype)
if err == nil && v.(*string) != nil {
@@ -93,6 +112,9 @@ func GetCustomType(field *google_protobuf.FieldDescriptorProto) string {
}
func GetCastType(field *google_protobuf.FieldDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Casttype)
if err == nil && v.(*string) != nil {
@@ -103,6 +125,9 @@ func GetCastType(field *google_protobuf.FieldDescriptorProto) string {
}
func GetCastKey(field *google_protobuf.FieldDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Castkey)
if err == nil && v.(*string) != nil {
@@ -113,6 +138,9 @@ func GetCastKey(field *google_protobuf.FieldDescriptorProto) string {
}
func GetCastValue(field *google_protobuf.FieldDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Castvalue)
if err == nil && v.(*string) != nil {
@@ -147,6 +175,9 @@ func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) bool
}
func GetCustomName(field *google_protobuf.FieldDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Customname)
if err == nil && v.(*string) != nil {
@@ -157,6 +188,9 @@ func GetCustomName(field *google_protobuf.FieldDescriptorProto) string {
}
func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_EnumCustomname)
if err == nil && v.(*string) != nil {
@@ -167,6 +201,9 @@ func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string {
}
func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) string {
+ if field == nil {
+ return ""
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_EnumvalueCustomname)
if err == nil && v.(*string) != nil {
@@ -177,6 +214,9 @@ func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) str
}
func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string {
+ if field == nil {
+ return nil
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Jsontag)
if err == nil && v.(*string) != nil {
@@ -187,6 +227,9 @@ func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string {
}
func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string {
+ if field == nil {
+ return nil
+ }
if field.Options != nil {
v, err := proto.GetExtension(field.Options, E_Moretags)
if err == nil && v.(*string) != nil {
@@ -308,3 +351,7 @@ func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool {
func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false))
}
+
+func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
+ return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false)
+}