diff --git a/backend/api/api/v1/annotations.pb.go b/backend/api/api/v1/annotations.pb.go new file mode 100644 index 0000000000..f35a45834b --- /dev/null +++ b/backend/api/api/v1/annotations.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: api/v1/annotations.proto + +package apiv1 + +import ( + proto "github.com/golang/protobuf/proto" + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var file_api_v1_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.MessageOptions)(nil), + ExtensionType: (*Reference)(nil), + Field: 58901, + Name: "clutch.api.v1.reference", + Tag: "bytes,58901,opt,name=reference", + Filename: "api/v1/annotations.proto", + }, + { + ExtendedType: (*descriptor.MessageOptions)(nil), + ExtensionType: (*Identifier)(nil), + Field: 58902, + Name: "clutch.api.v1.id", + Tag: "bytes,58902,opt,name=id", + Filename: "api/v1/annotations.proto", + }, + { + ExtendedType: (*descriptor.MethodOptions)(nil), + ExtensionType: (*Action)(nil), + Field: 58901, + Name: "clutch.api.v1.action", + Tag: "bytes,58901,opt,name=action", + Filename: "api/v1/annotations.proto", + }, +} + +// Extension fields to descriptor.MessageOptions. +var ( + // Use a random high number that won't conflict with annotations from other + // libraries. + // + // optional clutch.api.v1.Reference reference = 58901; + E_Reference = &file_api_v1_annotations_proto_extTypes[0] + // optional clutch.api.v1.Identifier id = 58902; + E_Id = &file_api_v1_annotations_proto_extTypes[1] +) + +// Extension fields to descriptor.MethodOptions. +var ( + // Use a random high number that won't conflict with annotations from other + // libraries. + // + // optional clutch.api.v1.Action action = 58901; + E_Action = &file_api_v1_annotations_proto_extTypes[2] +) + +var File_api_v1_annotations_proto protoreflect.FileDescriptor + +var file_api_v1_annotations_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x3a, 0x59, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x95, + 0xcc, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x4c, 0x0a, 0x02, 0x69, + 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x96, 0xcc, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x4f, 0x0a, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x95, 0xcc, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x5a, 0x05, 0x61, 0x70, + 0x69, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_api_v1_annotations_proto_goTypes = []interface{}{ + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.MethodOptions)(nil), // 1: google.protobuf.MethodOptions + (*Reference)(nil), // 2: clutch.api.v1.Reference + (*Identifier)(nil), // 3: clutch.api.v1.Identifier + (*Action)(nil), // 4: clutch.api.v1.Action +} +var file_api_v1_annotations_proto_depIdxs = []int32{ + 0, // 0: clutch.api.v1.reference:extendee -> google.protobuf.MessageOptions + 0, // 1: clutch.api.v1.id:extendee -> google.protobuf.MessageOptions + 1, // 2: clutch.api.v1.action:extendee -> google.protobuf.MethodOptions + 2, // 3: clutch.api.v1.reference:type_name -> clutch.api.v1.Reference + 3, // 4: clutch.api.v1.id:type_name -> clutch.api.v1.Identifier + 4, // 5: clutch.api.v1.action:type_name -> clutch.api.v1.Action + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 3, // [3:6] is the sub-list for extension type_name + 0, // [0:3] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_v1_annotations_proto_init() } +func file_api_v1_annotations_proto_init() { + if File_api_v1_annotations_proto != nil { + return + } + file_api_v1_schema_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_v1_annotations_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 3, + NumServices: 0, + }, + GoTypes: file_api_v1_annotations_proto_goTypes, + DependencyIndexes: file_api_v1_annotations_proto_depIdxs, + ExtensionInfos: file_api_v1_annotations_proto_extTypes, + }.Build() + File_api_v1_annotations_proto = out.File + file_api_v1_annotations_proto_rawDesc = nil + file_api_v1_annotations_proto_goTypes = nil + file_api_v1_annotations_proto_depIdxs = nil +} diff --git a/backend/api/api/v1/annotations.pb.validate.go b/backend/api/api/v1/annotations.pb.validate.go new file mode 100644 index 0000000000..a5c2274c02 --- /dev/null +++ b/backend/api/api/v1/annotations.pb.validate.go @@ -0,0 +1,37 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: api/v1/annotations.proto + +package apiv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _annotations_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") diff --git a/backend/api/api/v1/schema.pb.go b/backend/api/api/v1/schema.pb.go new file mode 100644 index 0000000000..b274be7aff --- /dev/null +++ b/backend/api/api/v1/schema.pb.go @@ -0,0 +1,418 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: api/v1/schema.proto + +package apiv1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ActionType int32 + +const ( + ActionType_UNSPECIFIED ActionType = 0 + ActionType_CREATE ActionType = 1 + ActionType_READ ActionType = 2 + ActionType_UPDATE ActionType = 3 + ActionType_DELETE ActionType = 4 +) + +// Enum value maps for ActionType. +var ( + ActionType_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "CREATE", + 2: "READ", + 3: "UPDATE", + 4: "DELETE", + } + ActionType_value = map[string]int32{ + "UNSPECIFIED": 0, + "CREATE": 1, + "READ": 2, + "UPDATE": 3, + "DELETE": 4, + } +) + +func (x ActionType) Enum() *ActionType { + p := new(ActionType) + *p = x + return p +} + +func (x ActionType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ActionType) Descriptor() protoreflect.EnumDescriptor { + return file_api_v1_schema_proto_enumTypes[0].Descriptor() +} + +func (ActionType) Type() protoreflect.EnumType { + return &file_api_v1_schema_proto_enumTypes[0] +} + +func (x ActionType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ActionType.Descriptor instead. +func (ActionType) EnumDescriptor() ([]byte, []int) { + return file_api_v1_schema_proto_rawDescGZIP(), []int{0} +} + +type Action struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type of action being performed. + Type ActionType `protobuf:"varint,1,opt,name=type,proto3,enum=clutch.api.v1.ActionType" json:"type,omitempty"` +} + +func (x *Action) Reset() { + *x = Action{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_schema_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Action) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Action) ProtoMessage() {} + +func (x *Action) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_schema_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Action.ProtoReflect.Descriptor instead. +func (*Action) Descriptor() ([]byte, []int) { + return file_api_v1_schema_proto_rawDescGZIP(), []int{0} +} + +func (x *Action) GetType() ActionType { + if x != nil { + return x.Type + } + return ActionType_UNSPECIFIED +} + +type Pattern struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type URL for the resource. + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` + // A string describing the resource name in terms + // of message members. + Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"` +} + +func (x *Pattern) Reset() { + *x = Pattern{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_schema_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pattern) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pattern) ProtoMessage() {} + +func (x *Pattern) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_schema_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pattern.ProtoReflect.Descriptor instead. +func (*Pattern) Descriptor() ([]byte, []int) { + return file_api_v1_schema_proto_rawDescGZIP(), []int{1} +} + +func (x *Pattern) GetTypeUrl() string { + if x != nil { + return x.TypeUrl + } + return "" +} + +func (x *Pattern) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +type Identifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Patterns []*Pattern `protobuf:"bytes,1,rep,name=patterns,proto3" json:"patterns,omitempty"` +} + +func (x *Identifier) Reset() { + *x = Identifier{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_schema_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Identifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Identifier) ProtoMessage() {} + +func (x *Identifier) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_schema_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Identifier.ProtoReflect.Descriptor instead. +func (*Identifier) Descriptor() ([]byte, []int) { + return file_api_v1_schema_proto_rawDescGZIP(), []int{2} +} + +func (x *Identifier) GetPatterns() []*Pattern { + if x != nil { + return x.Patterns + } + return nil +} + +type Reference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The field(s) which contain nested ResourceIdentifiers to + // identify resources contained in the message. + Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` +} + +func (x *Reference) Reset() { + *x = Reference{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_schema_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reference) ProtoMessage() {} + +func (x *Reference) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_schema_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reference.ProtoReflect.Descriptor instead. +func (*Reference) Descriptor() ([]byte, []int) { + return file_api_v1_schema_proto_rawDescGZIP(), []int{3} +} + +func (x *Reference) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +var File_api_v1_schema_proto protoreflect.FileDescriptor + +var file_api_v1_schema_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x22, 0x37, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3e, 0x0a, + 0x07, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, + 0x55, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x22, 0x40, 0x0a, + 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x70, + 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x52, 0x08, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x22, + 0x23, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x2a, 0x4b, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, + 0x08, 0x0a, 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, + 0x04, 0x42, 0x07, 0x5a, 0x05, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_api_v1_schema_proto_rawDescOnce sync.Once + file_api_v1_schema_proto_rawDescData = file_api_v1_schema_proto_rawDesc +) + +func file_api_v1_schema_proto_rawDescGZIP() []byte { + file_api_v1_schema_proto_rawDescOnce.Do(func() { + file_api_v1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_schema_proto_rawDescData) + }) + return file_api_v1_schema_proto_rawDescData +} + +var file_api_v1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_v1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_v1_schema_proto_goTypes = []interface{}{ + (ActionType)(0), // 0: clutch.api.v1.ActionType + (*Action)(nil), // 1: clutch.api.v1.Action + (*Pattern)(nil), // 2: clutch.api.v1.Pattern + (*Identifier)(nil), // 3: clutch.api.v1.Identifier + (*Reference)(nil), // 4: clutch.api.v1.Reference +} +var file_api_v1_schema_proto_depIdxs = []int32{ + 0, // 0: clutch.api.v1.Action.type:type_name -> clutch.api.v1.ActionType + 2, // 1: clutch.api.v1.Identifier.patterns:type_name -> clutch.api.v1.Pattern + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_api_v1_schema_proto_init() } +func file_api_v1_schema_proto_init() { + if File_api_v1_schema_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_v1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Action); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pattern); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Identifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_v1_schema_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_v1_schema_proto_goTypes, + DependencyIndexes: file_api_v1_schema_proto_depIdxs, + EnumInfos: file_api_v1_schema_proto_enumTypes, + MessageInfos: file_api_v1_schema_proto_msgTypes, + }.Build() + File_api_v1_schema_proto = out.File + file_api_v1_schema_proto_rawDesc = nil + file_api_v1_schema_proto_goTypes = nil + file_api_v1_schema_proto_depIdxs = nil +} diff --git a/backend/api/api/v1/schema.pb.validate.go b/backend/api/api/v1/schema.pb.validate.go new file mode 100644 index 0000000000..2356a29fb0 --- /dev/null +++ b/backend/api/api/v1/schema.pb.validate.go @@ -0,0 +1,314 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: api/v1/schema.proto + +package apiv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _schema_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Action with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Action) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Type + + return nil +} + +// ActionValidationError is the validation error returned by Action.Validate if +// the designated constraints aren't met. +type ActionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ActionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ActionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ActionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ActionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ActionValidationError) ErrorName() string { return "ActionValidationError" } + +// Error satisfies the builtin error interface +func (e ActionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAction.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ActionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ActionValidationError{} + +// Validate checks the field values on Pattern with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Pattern) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TypeUrl + + // no validation rules for Pattern + + return nil +} + +// PatternValidationError is the validation error returned by Pattern.Validate +// if the designated constraints aren't met. +type PatternValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PatternValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PatternValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PatternValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PatternValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PatternValidationError) ErrorName() string { return "PatternValidationError" } + +// Error satisfies the builtin error interface +func (e PatternValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPattern.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PatternValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PatternValidationError{} + +// Validate checks the field values on Identifier with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Identifier) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetPatterns() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IdentifierValidationError{ + field: fmt.Sprintf("Patterns[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// IdentifierValidationError is the validation error returned by +// Identifier.Validate if the designated constraints aren't met. +type IdentifierValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e IdentifierValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e IdentifierValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e IdentifierValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e IdentifierValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e IdentifierValidationError) ErrorName() string { return "IdentifierValidationError" } + +// Error satisfies the builtin error interface +func (e IdentifierValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sIdentifier.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = IdentifierValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = IdentifierValidationError{} + +// Validate checks the field values on Reference with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Reference) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// ReferenceValidationError is the validation error returned by +// Reference.Validate if the designated constraints aren't met. +type ReferenceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ReferenceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ReferenceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ReferenceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ReferenceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ReferenceValidationError) ErrorName() string { return "ReferenceValidationError" } + +// Error satisfies the builtin error interface +func (e ReferenceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sReference.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ReferenceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ReferenceValidationError{} diff --git a/backend/api/assets/v1/assets.pb.go b/backend/api/assets/v1/assets.pb.go new file mode 100644 index 0000000000..89b3046e3c --- /dev/null +++ b/backend/api/assets/v1/assets.pb.go @@ -0,0 +1,290 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: assets/v1/assets.proto + +package assetsv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type FetchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FetchRequest) Reset() { + *x = FetchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_assets_v1_assets_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchRequest) ProtoMessage() {} + +func (x *FetchRequest) ProtoReflect() protoreflect.Message { + mi := &file_assets_v1_assets_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead. +func (*FetchRequest) Descriptor() ([]byte, []int) { + return file_assets_v1_assets_proto_rawDescGZIP(), []int{0} +} + +type FetchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FetchResponse) Reset() { + *x = FetchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_assets_v1_assets_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchResponse) ProtoMessage() {} + +func (x *FetchResponse) ProtoReflect() protoreflect.Message { + mi := &file_assets_v1_assets_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead. +func (*FetchResponse) Descriptor() ([]byte, []int) { + return file_assets_v1_assets_proto_rawDescGZIP(), []int{1} +} + +var File_assets_v1_assets_proto protoreflect.FileDescriptor + +var file_assets_v1_assets_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x75, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x41, 0x50, 0x49, + 0x12, 0x68, 0x0a, 0x05, 0x46, 0x65, 0x74, 0x63, 0x68, 0x12, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x66, + 0x65, 0x74, 0x63, 0x68, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x42, 0x0a, 0x5a, 0x08, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_assets_v1_assets_proto_rawDescOnce sync.Once + file_assets_v1_assets_proto_rawDescData = file_assets_v1_assets_proto_rawDesc +) + +func file_assets_v1_assets_proto_rawDescGZIP() []byte { + file_assets_v1_assets_proto_rawDescOnce.Do(func() { + file_assets_v1_assets_proto_rawDescData = protoimpl.X.CompressGZIP(file_assets_v1_assets_proto_rawDescData) + }) + return file_assets_v1_assets_proto_rawDescData +} + +var file_assets_v1_assets_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_assets_v1_assets_proto_goTypes = []interface{}{ + (*FetchRequest)(nil), // 0: clutch.assets.v1.FetchRequest + (*FetchResponse)(nil), // 1: clutch.assets.v1.FetchResponse +} +var file_assets_v1_assets_proto_depIdxs = []int32{ + 0, // 0: clutch.assets.v1.AssetsAPI.Fetch:input_type -> clutch.assets.v1.FetchRequest + 1, // 1: clutch.assets.v1.AssetsAPI.Fetch:output_type -> clutch.assets.v1.FetchResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_assets_v1_assets_proto_init() } +func file_assets_v1_assets_proto_init() { + if File_assets_v1_assets_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_assets_v1_assets_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_assets_v1_assets_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_assets_v1_assets_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_assets_v1_assets_proto_goTypes, + DependencyIndexes: file_assets_v1_assets_proto_depIdxs, + MessageInfos: file_assets_v1_assets_proto_msgTypes, + }.Build() + File_assets_v1_assets_proto = out.File + file_assets_v1_assets_proto_rawDesc = nil + file_assets_v1_assets_proto_goTypes = nil + file_assets_v1_assets_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AssetsAPIClient is the client API for AssetsAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AssetsAPIClient interface { + // Fetch is a simple endpoint that is used to execute middleware (e.g. authentication) before serving an asset. + Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error) +} + +type assetsAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewAssetsAPIClient(cc grpc.ClientConnInterface) AssetsAPIClient { + return &assetsAPIClient{cc} +} + +func (c *assetsAPIClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error) { + out := new(FetchResponse) + err := c.cc.Invoke(ctx, "/clutch.assets.v1.AssetsAPI/Fetch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AssetsAPIServer is the server API for AssetsAPI service. +type AssetsAPIServer interface { + // Fetch is a simple endpoint that is used to execute middleware (e.g. authentication) before serving an asset. + Fetch(context.Context, *FetchRequest) (*FetchResponse, error) +} + +// UnimplementedAssetsAPIServer can be embedded to have forward compatible implementations. +type UnimplementedAssetsAPIServer struct { +} + +func (*UnimplementedAssetsAPIServer) Fetch(context.Context, *FetchRequest) (*FetchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented") +} + +func RegisterAssetsAPIServer(s *grpc.Server, srv AssetsAPIServer) { + s.RegisterService(&_AssetsAPI_serviceDesc, srv) +} + +func _AssetsAPI_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AssetsAPIServer).Fetch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.assets.v1.AssetsAPI/Fetch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AssetsAPIServer).Fetch(ctx, req.(*FetchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AssetsAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.assets.v1.AssetsAPI", + HandlerType: (*AssetsAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Fetch", + Handler: _AssetsAPI_Fetch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "assets/v1/assets.proto", +} diff --git a/backend/api/assets/v1/assets.pb.gw.go b/backend/api/assets/v1/assets.pb.gw.go new file mode 100644 index 0000000000..f9cc8aaeed --- /dev/null +++ b/backend/api/assets/v1/assets.pb.gw.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: assets/v1/assets.proto + +/* +Package assetsv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package assetsv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AssetsAPI_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client AssetsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FetchRequest + var metadata runtime.ServerMetadata + + msg, err := client.Fetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AssetsAPI_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server AssetsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FetchRequest + var metadata runtime.ServerMetadata + + msg, err := server.Fetch(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAssetsAPIHandlerServer registers the http handlers for service AssetsAPI to "mux". +// UnaryRPC :call AssetsAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAssetsAPIHandlerFromEndpoint instead. +func RegisterAssetsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AssetsAPIServer) error { + + mux.Handle("GET", pattern_AssetsAPI_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.assets.v1.AssetsAPI/Fetch") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AssetsAPI_Fetch_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AssetsAPI_Fetch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAssetsAPIHandlerFromEndpoint is same as RegisterAssetsAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAssetsAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAssetsAPIHandler(ctx, mux, conn) +} + +// RegisterAssetsAPIHandler registers the http handlers for service AssetsAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAssetsAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAssetsAPIHandlerClient(ctx, mux, NewAssetsAPIClient(conn)) +} + +// RegisterAssetsAPIHandlerClient registers the http handlers for service AssetsAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AssetsAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AssetsAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AssetsAPIClient" to call the correct interceptors. +func RegisterAssetsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AssetsAPIClient) error { + + mux.Handle("GET", pattern_AssetsAPI_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.assets.v1.AssetsAPI/Fetch") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AssetsAPI_Fetch_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AssetsAPI_Fetch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AssetsAPI_Fetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "assets", "fetch"}, "")) +) + +var ( + forward_AssetsAPI_Fetch_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/assets/v1/assets.pb.validate.go b/backend/api/assets/v1/assets.pb.validate.go new file mode 100644 index 0000000000..4d05f9f95a --- /dev/null +++ b/backend/api/assets/v1/assets.pb.validate.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: assets/v1/assets.proto + +package assetsv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _assets_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on FetchRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *FetchRequest) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// FetchRequestValidationError is the validation error returned by +// FetchRequest.Validate if the designated constraints aren't met. +type FetchRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FetchRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FetchRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FetchRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FetchRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FetchRequestValidationError) ErrorName() string { return "FetchRequestValidationError" } + +// Error satisfies the builtin error interface +func (e FetchRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFetchRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FetchRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FetchRequestValidationError{} + +// Validate checks the field values on FetchResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *FetchResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// FetchResponseValidationError is the validation error returned by +// FetchResponse.Validate if the designated constraints aren't met. +type FetchResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FetchResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FetchResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FetchResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FetchResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FetchResponseValidationError) ErrorName() string { return "FetchResponseValidationError" } + +// Error satisfies the builtin error interface +func (e FetchResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFetchResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FetchResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FetchResponseValidationError{} diff --git a/backend/api/audit/v1/audit.pb.go b/backend/api/audit/v1/audit.pb.go new file mode 100644 index 0000000000..3fc36730a3 --- /dev/null +++ b/backend/api/audit/v1/audit.pb.go @@ -0,0 +1,758 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: audit/v1/audit.proto + +package auditv1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + duration "github.com/golang/protobuf/ptypes/duration" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + v1 "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + status "google.golang.org/genproto/googleapis/rpc/status" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status1 "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type TimeRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` +} + +func (x *TimeRange) Reset() { + *x = TimeRange{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeRange) ProtoMessage() {} + +func (x *TimeRange) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TimeRange.ProtoReflect.Descriptor instead. +func (*TimeRange) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{0} +} + +func (x *TimeRange) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *TimeRange) GetEndTime() *timestamp.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +type GetEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Window: + // *GetEventsRequest_Range + // *GetEventsRequest_Since + Window isGetEventsRequest_Window `protobuf_oneof:"window"` +} + +func (x *GetEventsRequest) Reset() { + *x = GetEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEventsRequest) ProtoMessage() {} + +func (x *GetEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetEventsRequest.ProtoReflect.Descriptor instead. +func (*GetEventsRequest) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{1} +} + +func (m *GetEventsRequest) GetWindow() isGetEventsRequest_Window { + if m != nil { + return m.Window + } + return nil +} + +func (x *GetEventsRequest) GetRange() *TimeRange { + if x, ok := x.GetWindow().(*GetEventsRequest_Range); ok { + return x.Range + } + return nil +} + +func (x *GetEventsRequest) GetSince() *duration.Duration { + if x, ok := x.GetWindow().(*GetEventsRequest_Since); ok { + return x.Since + } + return nil +} + +type isGetEventsRequest_Window interface { + isGetEventsRequest_Window() +} + +type GetEventsRequest_Range struct { + Range *TimeRange `protobuf:"bytes,1,opt,name=range,proto3,oneof"` +} + +type GetEventsRequest_Since struct { + Since *duration.Duration `protobuf:"bytes,2,opt,name=since,proto3,oneof"` +} + +func (*GetEventsRequest_Range) isGetEventsRequest_Window() {} + +func (*GetEventsRequest_Since) isGetEventsRequest_Window() {} + +type Resource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *Resource) Reset() { + *x = Resource{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Resource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Resource) ProtoMessage() {} + +func (x *Resource) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Resource.ProtoReflect.Descriptor instead. +func (*Resource) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{2} +} + +func (x *Resource) GetTypeUrl() string { + if x != nil { + return x.TypeUrl + } + return "" +} + +func (x *Resource) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RequestEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // What attempted the action. + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // The service performing the operation. + ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + // The method being called. + MethodName string `protobuf:"bytes,3,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + // The type of operation being performed. + Type v1.ActionType `protobuf:"varint,4,opt,name=type,proto3,enum=clutch.api.v1.ActionType" json:"type,omitempty"` + // The status of the overall operation. + Status *status.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + // The resources touched during the event. + Resources []*Resource `protobuf:"bytes,6,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *RequestEvent) Reset() { + *x = RequestEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestEvent) ProtoMessage() {} + +func (x *RequestEvent) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestEvent.ProtoReflect.Descriptor instead. +func (*RequestEvent) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{3} +} + +func (x *RequestEvent) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *RequestEvent) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *RequestEvent) GetMethodName() string { + if x != nil { + return x.MethodName + } + return "" +} + +func (x *RequestEvent) GetType() v1.ActionType { + if x != nil { + return x.Type + } + return v1.ActionType_UNSPECIFIED +} + +func (x *RequestEvent) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *RequestEvent) GetResources() []*Resource { + if x != nil { + return x.Resources + } + return nil +} + +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // When the event happened. + OccurredAt *timestamp.Timestamp `protobuf:"bytes,1,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` + // Types that are assignable to EventType: + // *Event_Event + EventType isEvent_EventType `protobuf_oneof:"event_type"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{4} +} + +func (x *Event) GetOccurredAt() *timestamp.Timestamp { + if x != nil { + return x.OccurredAt + } + return nil +} + +func (m *Event) GetEventType() isEvent_EventType { + if m != nil { + return m.EventType + } + return nil +} + +func (x *Event) GetEvent() *RequestEvent { + if x, ok := x.GetEventType().(*Event_Event); ok { + return x.Event + } + return nil +} + +type isEvent_EventType interface { + isEvent_EventType() +} + +type Event_Event struct { + Event *RequestEvent `protobuf:"bytes,2,opt,name=event,proto3,oneof"` +} + +func (*Event_Event) isEvent_EventType() {} + +type GetEventsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *GetEventsResponse) Reset() { + *x = GetEventsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_audit_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEventsResponse) ProtoMessage() {} + +func (x *GetEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_audit_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetEventsResponse.ProtoReflect.Descriptor instead. +func (*GetEventsResponse) Descriptor() ([]byte, []int) { + return file_audit_v1_audit_proto_rawDescGZIP(), []int{5} +} + +func (x *GetEventsResponse) GetEvents() []*Event { + if x != nil { + return x.Events + } + return nil +} + +var File_audit_v1_audit_proto protoreflect.FileDescriptor + +var file_audit_v1_audit_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0x83, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x48, 0x00, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x73, 0x69, + 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x42, 0x08, 0x0a, + 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x63, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x2c, + 0xb2, 0xe1, 0x1c, 0x28, 0x0a, 0x26, 0x0a, 0x18, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x0a, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x7d, 0x22, 0xb8, 0x02, 0x0a, + 0x0c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, + 0x01, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, + 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x3a, 0x0f, 0xaa, 0xe1, 0x1c, 0x0b, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x35, + 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x84, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x64, + 0x69, 0x74, 0x41, 0x50, 0x49, 0x12, 0x78, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x65, 0x74, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x42, + 0x09, 0x5a, 0x07, 0x61, 0x75, 0x64, 0x69, 0x74, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_audit_v1_audit_proto_rawDescOnce sync.Once + file_audit_v1_audit_proto_rawDescData = file_audit_v1_audit_proto_rawDesc +) + +func file_audit_v1_audit_proto_rawDescGZIP() []byte { + file_audit_v1_audit_proto_rawDescOnce.Do(func() { + file_audit_v1_audit_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_v1_audit_proto_rawDescData) + }) + return file_audit_v1_audit_proto_rawDescData +} + +var file_audit_v1_audit_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_audit_v1_audit_proto_goTypes = []interface{}{ + (*TimeRange)(nil), // 0: clutch.audit.v1.TimeRange + (*GetEventsRequest)(nil), // 1: clutch.audit.v1.GetEventsRequest + (*Resource)(nil), // 2: clutch.audit.v1.Resource + (*RequestEvent)(nil), // 3: clutch.audit.v1.RequestEvent + (*Event)(nil), // 4: clutch.audit.v1.Event + (*GetEventsResponse)(nil), // 5: clutch.audit.v1.GetEventsResponse + (*timestamp.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*duration.Duration)(nil), // 7: google.protobuf.Duration + (v1.ActionType)(0), // 8: clutch.api.v1.ActionType + (*status.Status)(nil), // 9: google.rpc.Status +} +var file_audit_v1_audit_proto_depIdxs = []int32{ + 6, // 0: clutch.audit.v1.TimeRange.start_time:type_name -> google.protobuf.Timestamp + 6, // 1: clutch.audit.v1.TimeRange.end_time:type_name -> google.protobuf.Timestamp + 0, // 2: clutch.audit.v1.GetEventsRequest.range:type_name -> clutch.audit.v1.TimeRange + 7, // 3: clutch.audit.v1.GetEventsRequest.since:type_name -> google.protobuf.Duration + 8, // 4: clutch.audit.v1.RequestEvent.type:type_name -> clutch.api.v1.ActionType + 9, // 5: clutch.audit.v1.RequestEvent.status:type_name -> google.rpc.Status + 2, // 6: clutch.audit.v1.RequestEvent.resources:type_name -> clutch.audit.v1.Resource + 6, // 7: clutch.audit.v1.Event.occurred_at:type_name -> google.protobuf.Timestamp + 3, // 8: clutch.audit.v1.Event.event:type_name -> clutch.audit.v1.RequestEvent + 4, // 9: clutch.audit.v1.GetEventsResponse.events:type_name -> clutch.audit.v1.Event + 1, // 10: clutch.audit.v1.AuditAPI.GetEvents:input_type -> clutch.audit.v1.GetEventsRequest + 5, // 11: clutch.audit.v1.AuditAPI.GetEvents:output_type -> clutch.audit.v1.GetEventsResponse + 11, // [11:12] is the sub-list for method output_type + 10, // [10:11] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_audit_v1_audit_proto_init() } +func file_audit_v1_audit_proto_init() { + if File_audit_v1_audit_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_audit_v1_audit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_v1_audit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_v1_audit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Resource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_v1_audit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_v1_audit_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_audit_v1_audit_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEventsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_audit_v1_audit_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*GetEventsRequest_Range)(nil), + (*GetEventsRequest_Since)(nil), + } + file_audit_v1_audit_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*Event_Event)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_audit_v1_audit_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_audit_v1_audit_proto_goTypes, + DependencyIndexes: file_audit_v1_audit_proto_depIdxs, + MessageInfos: file_audit_v1_audit_proto_msgTypes, + }.Build() + File_audit_v1_audit_proto = out.File + file_audit_v1_audit_proto_rawDesc = nil + file_audit_v1_audit_proto_goTypes = nil + file_audit_v1_audit_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AuditAPIClient is the client API for AuditAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AuditAPIClient interface { + GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) +} + +type auditAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewAuditAPIClient(cc grpc.ClientConnInterface) AuditAPIClient { + return &auditAPIClient{cc} +} + +func (c *auditAPIClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) { + out := new(GetEventsResponse) + err := c.cc.Invoke(ctx, "/clutch.audit.v1.AuditAPI/GetEvents", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuditAPIServer is the server API for AuditAPI service. +type AuditAPIServer interface { + GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) +} + +// UnimplementedAuditAPIServer can be embedded to have forward compatible implementations. +type UnimplementedAuditAPIServer struct { +} + +func (*UnimplementedAuditAPIServer) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) { + return nil, status1.Errorf(codes.Unimplemented, "method GetEvents not implemented") +} + +func RegisterAuditAPIServer(s *grpc.Server, srv AuditAPIServer) { + s.RegisterService(&_AuditAPI_serviceDesc, srv) +} + +func _AuditAPI_GetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuditAPIServer).GetEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.audit.v1.AuditAPI/GetEvents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuditAPIServer).GetEvents(ctx, req.(*GetEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AuditAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.audit.v1.AuditAPI", + HandlerType: (*AuditAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetEvents", + Handler: _AuditAPI_GetEvents_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "audit/v1/audit.proto", +} diff --git a/backend/api/audit/v1/audit.pb.gw.go b/backend/api/audit/v1/audit.pb.gw.go new file mode 100644 index 0000000000..f4e656e081 --- /dev/null +++ b/backend/api/audit/v1/audit.pb.gw.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: audit/v1/audit.proto + +/* +Package auditv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package auditv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + status_0 "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AuditAPI_GetEvents_0(ctx context.Context, marshaler runtime.Marshaler, client AuditAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetEventsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetEvents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AuditAPI_GetEvents_0(ctx context.Context, marshaler runtime.Marshaler, server AuditAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetEventsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetEvents(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAuditAPIHandlerServer registers the http handlers for service AuditAPI to "mux". +// UnaryRPC :call AuditAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuditAPIHandlerFromEndpoint instead. +func RegisterAuditAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuditAPIServer) error { + + mux.Handle("POST", pattern_AuditAPI_GetEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.audit.v1.AuditAPI/GetEvents") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AuditAPI_GetEvents_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuditAPI_GetEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAuditAPIHandlerFromEndpoint is same as RegisterAuditAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAuditAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAuditAPIHandler(ctx, mux, conn) +} + +// RegisterAuditAPIHandler registers the http handlers for service AuditAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAuditAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAuditAPIHandlerClient(ctx, mux, NewAuditAPIClient(conn)) +} + +// RegisterAuditAPIHandlerClient registers the http handlers for service AuditAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuditAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuditAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AuditAPIClient" to call the correct interceptors. +func RegisterAuditAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuditAPIClient) error { + + mux.Handle("POST", pattern_AuditAPI_GetEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.audit.v1.AuditAPI/GetEvents") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AuditAPI_GetEvents_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuditAPI_GetEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AuditAPI_GetEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "audit", "getEvents"}, "")) +) + +var ( + forward_AuditAPI_GetEvents_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/audit/v1/audit.pb.validate.go b/backend/api/audit/v1/audit.pb.validate.go new file mode 100644 index 0000000000..96926a6e6e --- /dev/null +++ b/backend/api/audit/v1/audit.pb.validate.go @@ -0,0 +1,573 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: audit/v1/audit.proto + +package auditv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" + + v1 "github.com/lyft/clutch/backend/api/api/v1" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} + + _ = v1.ActionType(0) +) + +// define the regex for a UUID once up-front +var _audit_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on TimeRange with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *TimeRange) Validate() error { + if m == nil { + return nil + } + + if m.GetStartTime() == nil { + return TimeRangeValidationError{ + field: "StartTime", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetEndTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TimeRangeValidationError{ + field: "EndTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// TimeRangeValidationError is the validation error returned by +// TimeRange.Validate if the designated constraints aren't met. +type TimeRangeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TimeRangeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TimeRangeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TimeRangeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TimeRangeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TimeRangeValidationError) ErrorName() string { return "TimeRangeValidationError" } + +// Error satisfies the builtin error interface +func (e TimeRangeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTimeRange.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TimeRangeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TimeRangeValidationError{} + +// Validate checks the field values on GetEventsRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *GetEventsRequest) Validate() error { + if m == nil { + return nil + } + + switch m.Window.(type) { + + case *GetEventsRequest_Range: + + if v, ok := interface{}(m.GetRange()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetEventsRequestValidationError{ + field: "Range", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *GetEventsRequest_Since: + + if v, ok := interface{}(m.GetSince()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetEventsRequestValidationError{ + field: "Since", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// GetEventsRequestValidationError is the validation error returned by +// GetEventsRequest.Validate if the designated constraints aren't met. +type GetEventsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetEventsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetEventsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetEventsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetEventsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetEventsRequestValidationError) ErrorName() string { return "GetEventsRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetEventsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetEventsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetEventsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetEventsRequestValidationError{} + +// Validate checks the field values on Resource with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Resource) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TypeUrl + + // no validation rules for Id + + return nil +} + +// ResourceValidationError is the validation error returned by +// Resource.Validate if the designated constraints aren't met. +type ResourceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceValidationError) ErrorName() string { return "ResourceValidationError" } + +// Error satisfies the builtin error interface +func (e ResourceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResource.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceValidationError{} + +// Validate checks the field values on RequestEvent with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RequestEvent) Validate() error { + if m == nil { + return nil + } + + if utf8.RuneCountInString(m.GetUsername()) < 1 { + return RequestEventValidationError{ + field: "Username", + reason: "value length must be at least 1 runes", + } + } + + if utf8.RuneCountInString(m.GetServiceName()) < 1 { + return RequestEventValidationError{ + field: "ServiceName", + reason: "value length must be at least 1 runes", + } + } + + if utf8.RuneCountInString(m.GetMethodName()) < 1 { + return RequestEventValidationError{ + field: "MethodName", + reason: "value length must be at least 1 runes", + } + } + + if _, ok := v1.ActionType_name[int32(m.GetType())]; !ok { + return RequestEventValidationError{ + field: "Type", + reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RequestEventValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetResources() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RequestEventValidationError{ + field: fmt.Sprintf("Resources[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// RequestEventValidationError is the validation error returned by +// RequestEvent.Validate if the designated constraints aren't met. +type RequestEventValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RequestEventValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RequestEventValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RequestEventValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RequestEventValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RequestEventValidationError) ErrorName() string { return "RequestEventValidationError" } + +// Error satisfies the builtin error interface +func (e RequestEventValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRequestEvent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RequestEventValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RequestEventValidationError{} + +// Validate checks the field values on Event with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Event) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetOccurredAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EventValidationError{ + field: "OccurredAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + switch m.EventType.(type) { + + case *Event_Event: + + if v, ok := interface{}(m.GetEvent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EventValidationError{ + field: "Event", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// EventValidationError is the validation error returned by Event.Validate if +// the designated constraints aren't met. +type EventValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EventValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EventValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EventValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EventValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EventValidationError) ErrorName() string { return "EventValidationError" } + +// Error satisfies the builtin error interface +func (e EventValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sEvent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EventValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EventValidationError{} + +// Validate checks the field values on GetEventsResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *GetEventsResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetEvents() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetEventsResponseValidationError{ + field: fmt.Sprintf("Events[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// GetEventsResponseValidationError is the validation error returned by +// GetEventsResponse.Validate if the designated constraints aren't met. +type GetEventsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetEventsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetEventsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetEventsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetEventsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetEventsResponseValidationError) ErrorName() string { + return "GetEventsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetEventsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetEventsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetEventsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetEventsResponseValidationError{} diff --git a/backend/api/authn/v1/authn.pb.go b/backend/api/authn/v1/authn.pb.go new file mode 100644 index 0000000000..fcacf23544 --- /dev/null +++ b/backend/api/authn/v1/authn.pb.go @@ -0,0 +1,513 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: authn/v1/authn.proto + +package authnv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type LoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RedirectUrl string `protobuf:"bytes,1,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_authn_v1_authn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_authn_v1_authn_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_authn_v1_authn_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginRequest) GetRedirectUrl() string { + if x != nil { + return x.RedirectUrl + } + return "" +} + +type LoginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` +} + +func (x *LoginResponse) Reset() { + *x = LoginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_authn_v1_authn_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResponse) ProtoMessage() {} + +func (x *LoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_authn_v1_authn_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. +func (*LoginResponse) Descriptor() ([]byte, []int) { + return file_authn_v1_authn_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginResponse) GetAuthUrl() string { + if x != nil { + return x.AuthUrl + } + return "" +} + +// See https://www.oauth.com/oauth2-servers/authorization/the-authorization-response/ for description of the parameters. +type CallbackRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` + ErrorDescription string `protobuf:"bytes,4,opt,name=error_description,json=errorDescription,proto3" json:"error_description,omitempty"` +} + +func (x *CallbackRequest) Reset() { + *x = CallbackRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_authn_v1_authn_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallbackRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallbackRequest) ProtoMessage() {} + +func (x *CallbackRequest) ProtoReflect() protoreflect.Message { + mi := &file_authn_v1_authn_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallbackRequest.ProtoReflect.Descriptor instead. +func (*CallbackRequest) Descriptor() ([]byte, []int) { + return file_authn_v1_authn_proto_rawDescGZIP(), []int{2} +} + +func (x *CallbackRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *CallbackRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *CallbackRequest) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *CallbackRequest) GetErrorDescription() string { + if x != nil { + return x.ErrorDescription + } + return "" +} + +type CallbackResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This is the token that the user should present. Note: this response is only valid in a gRPC context. In an HTTP + // context the user will be redirected. + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` +} + +func (x *CallbackResponse) Reset() { + *x = CallbackResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_authn_v1_authn_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallbackResponse) ProtoMessage() {} + +func (x *CallbackResponse) ProtoReflect() protoreflect.Message { + mi := &file_authn_v1_authn_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallbackResponse.ProtoReflect.Descriptor instead. +func (*CallbackResponse) Descriptor() ([]byte, []int) { + return file_authn_v1_authn_proto_rawDescGZIP(), []int{3} +} + +func (x *CallbackResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +var File_authn_v1_authn_proto protoreflect.FileDescriptor + +var file_authn_v1_authn_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x31, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, + 0x72, 0x6c, 0x22, 0x2a, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, 0x22, 0x7e, + 0x0a, 0x0f, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, + 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xe4, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x41, + 0x50, 0x49, 0x12, 0x65, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1d, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2f, 0x6c, 0x6f, + 0x67, 0x69, 0x6e, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0x71, 0x0a, 0x08, 0x43, 0x61, 0x6c, + 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2f, 0x63, 0x61, + 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x01, 0x42, 0x09, 0x5a, 0x07, + 0x61, 0x75, 0x74, 0x68, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_authn_v1_authn_proto_rawDescOnce sync.Once + file_authn_v1_authn_proto_rawDescData = file_authn_v1_authn_proto_rawDesc +) + +func file_authn_v1_authn_proto_rawDescGZIP() []byte { + file_authn_v1_authn_proto_rawDescOnce.Do(func() { + file_authn_v1_authn_proto_rawDescData = protoimpl.X.CompressGZIP(file_authn_v1_authn_proto_rawDescData) + }) + return file_authn_v1_authn_proto_rawDescData +} + +var file_authn_v1_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_authn_v1_authn_proto_goTypes = []interface{}{ + (*LoginRequest)(nil), // 0: clutch.authn.v1.LoginRequest + (*LoginResponse)(nil), // 1: clutch.authn.v1.LoginResponse + (*CallbackRequest)(nil), // 2: clutch.authn.v1.CallbackRequest + (*CallbackResponse)(nil), // 3: clutch.authn.v1.CallbackResponse +} +var file_authn_v1_authn_proto_depIdxs = []int32{ + 0, // 0: clutch.authn.v1.AuthnAPI.Login:input_type -> clutch.authn.v1.LoginRequest + 2, // 1: clutch.authn.v1.AuthnAPI.Callback:input_type -> clutch.authn.v1.CallbackRequest + 1, // 2: clutch.authn.v1.AuthnAPI.Login:output_type -> clutch.authn.v1.LoginResponse + 3, // 3: clutch.authn.v1.AuthnAPI.Callback:output_type -> clutch.authn.v1.CallbackResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_authn_v1_authn_proto_init() } +func file_authn_v1_authn_proto_init() { + if File_authn_v1_authn_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_authn_v1_authn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authn_v1_authn_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authn_v1_authn_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallbackRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authn_v1_authn_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallbackResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_authn_v1_authn_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_authn_v1_authn_proto_goTypes, + DependencyIndexes: file_authn_v1_authn_proto_depIdxs, + MessageInfos: file_authn_v1_authn_proto_msgTypes, + }.Build() + File_authn_v1_authn_proto = out.File + file_authn_v1_authn_proto_rawDesc = nil + file_authn_v1_authn_proto_goTypes = nil + file_authn_v1_authn_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AuthnAPIClient is the client API for AuthnAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AuthnAPIClient interface { + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + Callback(ctx context.Context, in *CallbackRequest, opts ...grpc.CallOption) (*CallbackResponse, error) +} + +type authnAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthnAPIClient(cc grpc.ClientConnInterface) AuthnAPIClient { + return &authnAPIClient{cc} +} + +func (c *authnAPIClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + out := new(LoginResponse) + err := c.cc.Invoke(ctx, "/clutch.authn.v1.AuthnAPI/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authnAPIClient) Callback(ctx context.Context, in *CallbackRequest, opts ...grpc.CallOption) (*CallbackResponse, error) { + out := new(CallbackResponse) + err := c.cc.Invoke(ctx, "/clutch.authn.v1.AuthnAPI/Callback", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthnAPIServer is the server API for AuthnAPI service. +type AuthnAPIServer interface { + Login(context.Context, *LoginRequest) (*LoginResponse, error) + Callback(context.Context, *CallbackRequest) (*CallbackResponse, error) +} + +// UnimplementedAuthnAPIServer can be embedded to have forward compatible implementations. +type UnimplementedAuthnAPIServer struct { +} + +func (*UnimplementedAuthnAPIServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (*UnimplementedAuthnAPIServer) Callback(context.Context, *CallbackRequest) (*CallbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Callback not implemented") +} + +func RegisterAuthnAPIServer(s *grpc.Server, srv AuthnAPIServer) { + s.RegisterService(&_AuthnAPI_serviceDesc, srv) +} + +func _AuthnAPI_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthnAPIServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.authn.v1.AuthnAPI/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthnAPIServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthnAPI_Callback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CallbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthnAPIServer).Callback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.authn.v1.AuthnAPI/Callback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthnAPIServer).Callback(ctx, req.(*CallbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AuthnAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.authn.v1.AuthnAPI", + HandlerType: (*AuthnAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Login", + Handler: _AuthnAPI_Login_Handler, + }, + { + MethodName: "Callback", + Handler: _AuthnAPI_Callback_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "authn/v1/authn.proto", +} diff --git a/backend/api/authn/v1/authn.pb.gw.go b/backend/api/authn/v1/authn.pb.gw.go new file mode 100644 index 0000000000..0f9cfe4a14 --- /dev/null +++ b/backend/api/authn/v1/authn.pb.gw.go @@ -0,0 +1,252 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: authn/v1/authn.proto + +/* +Package authnv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package authnv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +var ( + filter_AuthnAPI_Login_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AuthnAPI_Login_0(ctx context.Context, marshaler runtime.Marshaler, client AuthnAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq LoginRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthnAPI_Login_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AuthnAPI_Login_0(ctx context.Context, marshaler runtime.Marshaler, server AuthnAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq LoginRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthnAPI_Login_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Login(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_AuthnAPI_Callback_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AuthnAPI_Callback_0(ctx context.Context, marshaler runtime.Marshaler, client AuthnAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CallbackRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthnAPI_Callback_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Callback(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AuthnAPI_Callback_0(ctx context.Context, marshaler runtime.Marshaler, server AuthnAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CallbackRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthnAPI_Callback_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Callback(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAuthnAPIHandlerServer registers the http handlers for service AuthnAPI to "mux". +// UnaryRPC :call AuthnAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthnAPIHandlerFromEndpoint instead. +func RegisterAuthnAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthnAPIServer) error { + + mux.Handle("GET", pattern_AuthnAPI_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.authn.v1.AuthnAPI/Login") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AuthnAPI_Login_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthnAPI_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AuthnAPI_Callback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.authn.v1.AuthnAPI/Callback") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AuthnAPI_Callback_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthnAPI_Callback_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAuthnAPIHandlerFromEndpoint is same as RegisterAuthnAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAuthnAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAuthnAPIHandler(ctx, mux, conn) +} + +// RegisterAuthnAPIHandler registers the http handlers for service AuthnAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAuthnAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAuthnAPIHandlerClient(ctx, mux, NewAuthnAPIClient(conn)) +} + +// RegisterAuthnAPIHandlerClient registers the http handlers for service AuthnAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthnAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthnAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AuthnAPIClient" to call the correct interceptors. +func RegisterAuthnAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthnAPIClient) error { + + mux.Handle("GET", pattern_AuthnAPI_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.authn.v1.AuthnAPI/Login") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AuthnAPI_Login_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthnAPI_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AuthnAPI_Callback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.authn.v1.AuthnAPI/Callback") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AuthnAPI_Callback_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthnAPI_Callback_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AuthnAPI_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "authn", "login"}, "")) + + pattern_AuthnAPI_Callback_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "authn", "callback"}, "")) +) + +var ( + forward_AuthnAPI_Login_0 = runtime.ForwardResponseMessage + + forward_AuthnAPI_Callback_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/authn/v1/authn.pb.validate.go b/backend/api/authn/v1/authn.pb.validate.go new file mode 100644 index 0000000000..520d949d8c --- /dev/null +++ b/backend/api/authn/v1/authn.pb.validate.go @@ -0,0 +1,311 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: authn/v1/authn.proto + +package authnv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _authn_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on LoginRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *LoginRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RedirectUrl + + return nil +} + +// LoginRequestValidationError is the validation error returned by +// LoginRequest.Validate if the designated constraints aren't met. +type LoginRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoginRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoginRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoginRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoginRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoginRequestValidationError) ErrorName() string { return "LoginRequestValidationError" } + +// Error satisfies the builtin error interface +func (e LoginRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLoginRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoginRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoginRequestValidationError{} + +// Validate checks the field values on LoginResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *LoginResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for AuthUrl + + return nil +} + +// LoginResponseValidationError is the validation error returned by +// LoginResponse.Validate if the designated constraints aren't met. +type LoginResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoginResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoginResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoginResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoginResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoginResponseValidationError) ErrorName() string { return "LoginResponseValidationError" } + +// Error satisfies the builtin error interface +func (e LoginResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLoginResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoginResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoginResponseValidationError{} + +// Validate checks the field values on CallbackRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *CallbackRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Code + + // no validation rules for State + + // no validation rules for Error + + // no validation rules for ErrorDescription + + return nil +} + +// CallbackRequestValidationError is the validation error returned by +// CallbackRequest.Validate if the designated constraints aren't met. +type CallbackRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CallbackRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CallbackRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CallbackRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CallbackRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CallbackRequestValidationError) ErrorName() string { return "CallbackRequestValidationError" } + +// Error satisfies the builtin error interface +func (e CallbackRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCallbackRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CallbackRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CallbackRequestValidationError{} + +// Validate checks the field values on CallbackResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *CallbackResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for AccessToken + + return nil +} + +// CallbackResponseValidationError is the validation error returned by +// CallbackResponse.Validate if the designated constraints aren't met. +type CallbackResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CallbackResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CallbackResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CallbackResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CallbackResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CallbackResponseValidationError) ErrorName() string { return "CallbackResponseValidationError" } + +// Error satisfies the builtin error interface +func (e CallbackResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCallbackResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CallbackResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CallbackResponseValidationError{} diff --git a/backend/api/authz/v1/authz.pb.go b/backend/api/authz/v1/authz.pb.go new file mode 100644 index 0000000000..e78a1e3cdd --- /dev/null +++ b/backend/api/authz/v1/authz.pb.go @@ -0,0 +1,479 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: authz/v1/authz.proto + +package authzv1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + v1 "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Decision int32 + +const ( + Decision_UNSPECIFIED Decision = 0 + Decision_DENY Decision = 1 + Decision_ALLOW Decision = 2 +) + +// Enum value maps for Decision. +var ( + Decision_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "DENY", + 2: "ALLOW", + } + Decision_value = map[string]int32{ + "UNSPECIFIED": 0, + "DENY": 1, + "ALLOW": 2, + } +) + +func (x Decision) Enum() *Decision { + p := new(Decision) + *p = x + return p +} + +func (x Decision) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Decision) Descriptor() protoreflect.EnumDescriptor { + return file_authz_v1_authz_proto_enumTypes[0].Descriptor() +} + +func (Decision) Type() protoreflect.EnumType { + return &file_authz_v1_authz_proto_enumTypes[0] +} + +func (x Decision) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Decision.Descriptor instead. +func (Decision) EnumDescriptor() ([]byte, []int) { + return file_authz_v1_authz_proto_rawDescGZIP(), []int{0} +} + +type Subject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Groups []string `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` +} + +func (x *Subject) Reset() { + *x = Subject{} + if protoimpl.UnsafeEnabled { + mi := &file_authz_v1_authz_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Subject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Subject) ProtoMessage() {} + +func (x *Subject) ProtoReflect() protoreflect.Message { + mi := &file_authz_v1_authz_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Subject.ProtoReflect.Descriptor instead. +func (*Subject) Descriptor() ([]byte, []int) { + return file_authz_v1_authz_proto_rawDescGZIP(), []int{0} +} + +func (x *Subject) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *Subject) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +type CheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject *Subject `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + ActionType v1.ActionType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=clutch.api.v1.ActionType" json:"action_type,omitempty"` + Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *CheckRequest) Reset() { + *x = CheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_authz_v1_authz_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckRequest) ProtoMessage() {} + +func (x *CheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_authz_v1_authz_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead. +func (*CheckRequest) Descriptor() ([]byte, []int) { + return file_authz_v1_authz_proto_rawDescGZIP(), []int{1} +} + +func (x *CheckRequest) GetSubject() *Subject { + if x != nil { + return x.Subject + } + return nil +} + +func (x *CheckRequest) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *CheckRequest) GetActionType() v1.ActionType { + if x != nil { + return x.ActionType + } + return v1.ActionType_UNSPECIFIED +} + +func (x *CheckRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +type CheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Decision Decision `protobuf:"varint,1,opt,name=decision,proto3,enum=clutch.authz.v1.Decision" json:"decision,omitempty"` +} + +func (x *CheckResponse) Reset() { + *x = CheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_authz_v1_authz_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckResponse) ProtoMessage() {} + +func (x *CheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_authz_v1_authz_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead. +func (*CheckResponse) Descriptor() ([]byte, []int) { + return file_authz_v1_authz_proto_rawDescGZIP(), []int{2} +} + +func (x *CheckResponse) GetDecision() Decision { + if x != nil { + return x.Decision + } + return Decision_UNSPECIFIED +} + +var File_authz_v1_authz_proto protoreflect.FileDescriptor + +var file_authz_v1_authz_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, + 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x3a, 0x0a, 0x0b, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x30, 0x0a, 0x08, 0x44, + 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x4e, 0x59, + 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x02, 0x32, 0x74, 0x0a, + 0x08, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x41, 0x50, 0x49, 0x12, 0x68, 0x0a, 0x05, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, + 0x02, 0x08, 0x02, 0x42, 0x09, 0x5a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_authz_v1_authz_proto_rawDescOnce sync.Once + file_authz_v1_authz_proto_rawDescData = file_authz_v1_authz_proto_rawDesc +) + +func file_authz_v1_authz_proto_rawDescGZIP() []byte { + file_authz_v1_authz_proto_rawDescOnce.Do(func() { + file_authz_v1_authz_proto_rawDescData = protoimpl.X.CompressGZIP(file_authz_v1_authz_proto_rawDescData) + }) + return file_authz_v1_authz_proto_rawDescData +} + +var file_authz_v1_authz_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_authz_v1_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_authz_v1_authz_proto_goTypes = []interface{}{ + (Decision)(0), // 0: clutch.authz.v1.Decision + (*Subject)(nil), // 1: clutch.authz.v1.Subject + (*CheckRequest)(nil), // 2: clutch.authz.v1.CheckRequest + (*CheckResponse)(nil), // 3: clutch.authz.v1.CheckResponse + (v1.ActionType)(0), // 4: clutch.api.v1.ActionType +} +var file_authz_v1_authz_proto_depIdxs = []int32{ + 1, // 0: clutch.authz.v1.CheckRequest.subject:type_name -> clutch.authz.v1.Subject + 4, // 1: clutch.authz.v1.CheckRequest.action_type:type_name -> clutch.api.v1.ActionType + 0, // 2: clutch.authz.v1.CheckResponse.decision:type_name -> clutch.authz.v1.Decision + 2, // 3: clutch.authz.v1.AuthzAPI.Check:input_type -> clutch.authz.v1.CheckRequest + 3, // 4: clutch.authz.v1.AuthzAPI.Check:output_type -> clutch.authz.v1.CheckResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_authz_v1_authz_proto_init() } +func file_authz_v1_authz_proto_init() { + if File_authz_v1_authz_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_authz_v1_authz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Subject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authz_v1_authz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authz_v1_authz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_authz_v1_authz_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_authz_v1_authz_proto_goTypes, + DependencyIndexes: file_authz_v1_authz_proto_depIdxs, + EnumInfos: file_authz_v1_authz_proto_enumTypes, + MessageInfos: file_authz_v1_authz_proto_msgTypes, + }.Build() + File_authz_v1_authz_proto = out.File + file_authz_v1_authz_proto_rawDesc = nil + file_authz_v1_authz_proto_goTypes = nil + file_authz_v1_authz_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AuthzAPIClient is the client API for AuthzAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AuthzAPIClient interface { + Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) +} + +type authzAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthzAPIClient(cc grpc.ClientConnInterface) AuthzAPIClient { + return &authzAPIClient{cc} +} + +func (c *authzAPIClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) { + out := new(CheckResponse) + err := c.cc.Invoke(ctx, "/clutch.authz.v1.AuthzAPI/Check", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthzAPIServer is the server API for AuthzAPI service. +type AuthzAPIServer interface { + Check(context.Context, *CheckRequest) (*CheckResponse, error) +} + +// UnimplementedAuthzAPIServer can be embedded to have forward compatible implementations. +type UnimplementedAuthzAPIServer struct { +} + +func (*UnimplementedAuthzAPIServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} + +func RegisterAuthzAPIServer(s *grpc.Server, srv AuthzAPIServer) { + s.RegisterService(&_AuthzAPI_serviceDesc, srv) +} + +func _AuthzAPI_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthzAPIServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.authz.v1.AuthzAPI/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthzAPIServer).Check(ctx, req.(*CheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AuthzAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.authz.v1.AuthzAPI", + HandlerType: (*AuthzAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _AuthzAPI_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "authz/v1/authz.proto", +} diff --git a/backend/api/authz/v1/authz.pb.gw.go b/backend/api/authz/v1/authz.pb.gw.go new file mode 100644 index 0000000000..e81547abbe --- /dev/null +++ b/backend/api/authz/v1/authz.pb.gw.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: authz/v1/authz.proto + +/* +Package authzv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package authzv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AuthzAPI_Check_0(ctx context.Context, marshaler runtime.Marshaler, client AuthzAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CheckRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Check(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AuthzAPI_Check_0(ctx context.Context, marshaler runtime.Marshaler, server AuthzAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CheckRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Check(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAuthzAPIHandlerServer registers the http handlers for service AuthzAPI to "mux". +// UnaryRPC :call AuthzAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthzAPIHandlerFromEndpoint instead. +func RegisterAuthzAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzAPIServer) error { + + mux.Handle("POST", pattern_AuthzAPI_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.authz.v1.AuthzAPI/Check") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AuthzAPI_Check_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthzAPI_Check_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAuthzAPIHandlerFromEndpoint is same as RegisterAuthzAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAuthzAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAuthzAPIHandler(ctx, mux, conn) +} + +// RegisterAuthzAPIHandler registers the http handlers for service AuthzAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAuthzAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAuthzAPIHandlerClient(ctx, mux, NewAuthzAPIClient(conn)) +} + +// RegisterAuthzAPIHandlerClient registers the http handlers for service AuthzAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthzAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthzAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AuthzAPIClient" to call the correct interceptors. +func RegisterAuthzAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzAPIClient) error { + + mux.Handle("POST", pattern_AuthzAPI_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.authz.v1.AuthzAPI/Check") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AuthzAPI_Check_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AuthzAPI_Check_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AuthzAPI_Check_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "authz", "check"}, "")) +) + +var ( + forward_AuthzAPI_Check_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/authz/v1/authz.pb.validate.go b/backend/api/authz/v1/authz.pb.validate.go new file mode 100644 index 0000000000..fbf5e78dab --- /dev/null +++ b/backend/api/authz/v1/authz.pb.validate.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: authz/v1/authz.proto + +package authzv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" + + v1 "github.com/lyft/clutch/backend/api/api/v1" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} + + _ = v1.ActionType(0) +) + +// define the regex for a UUID once up-front +var _authz_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Subject with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Subject) Validate() error { + if m == nil { + return nil + } + + // no validation rules for User + + return nil +} + +// SubjectValidationError is the validation error returned by Subject.Validate +// if the designated constraints aren't met. +type SubjectValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SubjectValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SubjectValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SubjectValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SubjectValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SubjectValidationError) ErrorName() string { return "SubjectValidationError" } + +// Error satisfies the builtin error interface +func (e SubjectValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSubject.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SubjectValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SubjectValidationError{} + +// Validate checks the field values on CheckRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *CheckRequest) Validate() error { + if m == nil { + return nil + } + + if m.GetSubject() == nil { + return CheckRequestValidationError{ + field: "Subject", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CheckRequestValidationError{ + field: "Subject", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Method + + // no validation rules for ActionType + + // no validation rules for Resource + + return nil +} + +// CheckRequestValidationError is the validation error returned by +// CheckRequest.Validate if the designated constraints aren't met. +type CheckRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CheckRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CheckRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CheckRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CheckRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CheckRequestValidationError) ErrorName() string { return "CheckRequestValidationError" } + +// Error satisfies the builtin error interface +func (e CheckRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCheckRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CheckRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CheckRequestValidationError{} + +// Validate checks the field values on CheckResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *CheckResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Decision + + return nil +} + +// CheckResponseValidationError is the validation error returned by +// CheckResponse.Validate if the designated constraints aren't met. +type CheckResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CheckResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CheckResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CheckResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CheckResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CheckResponseValidationError) ErrorName() string { return "CheckResponseValidationError" } + +// Error satisfies the builtin error interface +func (e CheckResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCheckResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CheckResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CheckResponseValidationError{} diff --git a/backend/api/aws/ec2/v1/ec2.pb.go b/backend/api/aws/ec2/v1/ec2.pb.go new file mode 100644 index 0000000000..793f484119 --- /dev/null +++ b/backend/api/aws/ec2/v1/ec2.pb.go @@ -0,0 +1,1433 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: aws/ec2/v1/ec2.proto + +package ec2v1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type AutoscalingGroup_TerminationPolicy int32 + +const ( + AutoscalingGroup_UNSPECIFIED AutoscalingGroup_TerminationPolicy = 0 + AutoscalingGroup_UNKNOWN AutoscalingGroup_TerminationPolicy = 1 + AutoscalingGroup_OLDEST_INSTANCE AutoscalingGroup_TerminationPolicy = 2 + AutoscalingGroup_NEWEST_INSTANCE AutoscalingGroup_TerminationPolicy = 3 + AutoscalingGroup_OLDEST_LAUNCH_CONFIGURATION AutoscalingGroup_TerminationPolicy = 4 + AutoscalingGroup_CLOSEST_TO_NEXT_HOUR AutoscalingGroup_TerminationPolicy = 5 + AutoscalingGroup_DEFAULT AutoscalingGroup_TerminationPolicy = 6 + AutoscalingGroup_OLDEST_LAUNCH_TEMPLATE AutoscalingGroup_TerminationPolicy = 7 + AutoscalingGroup_ALLOCATION_STRATEGY AutoscalingGroup_TerminationPolicy = 8 +) + +// Enum value maps for AutoscalingGroup_TerminationPolicy. +var ( + AutoscalingGroup_TerminationPolicy_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "OLDEST_INSTANCE", + 3: "NEWEST_INSTANCE", + 4: "OLDEST_LAUNCH_CONFIGURATION", + 5: "CLOSEST_TO_NEXT_HOUR", + 6: "DEFAULT", + 7: "OLDEST_LAUNCH_TEMPLATE", + 8: "ALLOCATION_STRATEGY", + } + AutoscalingGroup_TerminationPolicy_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "OLDEST_INSTANCE": 2, + "NEWEST_INSTANCE": 3, + "OLDEST_LAUNCH_CONFIGURATION": 4, + "CLOSEST_TO_NEXT_HOUR": 5, + "DEFAULT": 6, + "OLDEST_LAUNCH_TEMPLATE": 7, + "ALLOCATION_STRATEGY": 8, + } +) + +func (x AutoscalingGroup_TerminationPolicy) Enum() *AutoscalingGroup_TerminationPolicy { + p := new(AutoscalingGroup_TerminationPolicy) + *p = x + return p +} + +func (x AutoscalingGroup_TerminationPolicy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AutoscalingGroup_TerminationPolicy) Descriptor() protoreflect.EnumDescriptor { + return file_aws_ec2_v1_ec2_proto_enumTypes[0].Descriptor() +} + +func (AutoscalingGroup_TerminationPolicy) Type() protoreflect.EnumType { + return &file_aws_ec2_v1_ec2_proto_enumTypes[0] +} + +func (x AutoscalingGroup_TerminationPolicy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AutoscalingGroup_TerminationPolicy.Descriptor instead. +func (AutoscalingGroup_TerminationPolicy) EnumDescriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{3, 0} +} + +type AutoscalingGroup_Instance_LifecycleState int32 + +const ( + AutoscalingGroup_Instance_UNSPECIFIED AutoscalingGroup_Instance_LifecycleState = 0 + AutoscalingGroup_Instance_UNKNOWN AutoscalingGroup_Instance_LifecycleState = 1 + AutoscalingGroup_Instance_PENDING AutoscalingGroup_Instance_LifecycleState = 2 + AutoscalingGroup_Instance_PENDING_WAIT AutoscalingGroup_Instance_LifecycleState = 3 + AutoscalingGroup_Instance_PENDING_PROCEED AutoscalingGroup_Instance_LifecycleState = 4 + AutoscalingGroup_Instance_QUARANTINED AutoscalingGroup_Instance_LifecycleState = 5 + AutoscalingGroup_Instance_IN_SERVICE AutoscalingGroup_Instance_LifecycleState = 6 + AutoscalingGroup_Instance_TERMINATING AutoscalingGroup_Instance_LifecycleState = 7 + AutoscalingGroup_Instance_TERMINATING_WAIT AutoscalingGroup_Instance_LifecycleState = 8 + AutoscalingGroup_Instance_TERMINATING_PROCEED AutoscalingGroup_Instance_LifecycleState = 9 + AutoscalingGroup_Instance_TERMINATED AutoscalingGroup_Instance_LifecycleState = 10 + AutoscalingGroup_Instance_DETACHING AutoscalingGroup_Instance_LifecycleState = 11 + AutoscalingGroup_Instance_DETACHED AutoscalingGroup_Instance_LifecycleState = 12 + AutoscalingGroup_Instance_ENTERING_STANDBY AutoscalingGroup_Instance_LifecycleState = 13 + AutoscalingGroup_Instance_STANDBY AutoscalingGroup_Instance_LifecycleState = 14 +) + +// Enum value maps for AutoscalingGroup_Instance_LifecycleState. +var ( + AutoscalingGroup_Instance_LifecycleState_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "PENDING", + 3: "PENDING_WAIT", + 4: "PENDING_PROCEED", + 5: "QUARANTINED", + 6: "IN_SERVICE", + 7: "TERMINATING", + 8: "TERMINATING_WAIT", + 9: "TERMINATING_PROCEED", + 10: "TERMINATED", + 11: "DETACHING", + 12: "DETACHED", + 13: "ENTERING_STANDBY", + 14: "STANDBY", + } + AutoscalingGroup_Instance_LifecycleState_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "PENDING": 2, + "PENDING_WAIT": 3, + "PENDING_PROCEED": 4, + "QUARANTINED": 5, + "IN_SERVICE": 6, + "TERMINATING": 7, + "TERMINATING_WAIT": 8, + "TERMINATING_PROCEED": 9, + "TERMINATED": 10, + "DETACHING": 11, + "DETACHED": 12, + "ENTERING_STANDBY": 13, + "STANDBY": 14, + } +) + +func (x AutoscalingGroup_Instance_LifecycleState) Enum() *AutoscalingGroup_Instance_LifecycleState { + p := new(AutoscalingGroup_Instance_LifecycleState) + *p = x + return p +} + +func (x AutoscalingGroup_Instance_LifecycleState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AutoscalingGroup_Instance_LifecycleState) Descriptor() protoreflect.EnumDescriptor { + return file_aws_ec2_v1_ec2_proto_enumTypes[1].Descriptor() +} + +func (AutoscalingGroup_Instance_LifecycleState) Type() protoreflect.EnumType { + return &file_aws_ec2_v1_ec2_proto_enumTypes[1] +} + +func (x AutoscalingGroup_Instance_LifecycleState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AutoscalingGroup_Instance_LifecycleState.Descriptor instead. +func (AutoscalingGroup_Instance_LifecycleState) EnumDescriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{3, 0, 0} +} + +// https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceState.html +type Instance_State int32 + +const ( + Instance_UNSPECIFIED Instance_State = 0 + Instance_UNKNOWN Instance_State = 1 + Instance_PENDING Instance_State = 2 + Instance_RUNNING Instance_State = 3 + Instance_STOPPING Instance_State = 4 + Instance_STOPPED Instance_State = 5 + Instance_SHUTTING_DOWN Instance_State = 6 + Instance_TERMINATED Instance_State = 7 +) + +// Enum value maps for Instance_State. +var ( + Instance_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "PENDING", + 3: "RUNNING", + 4: "STOPPING", + 5: "STOPPED", + 6: "SHUTTING_DOWN", + 7: "TERMINATED", + } + Instance_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "PENDING": 2, + "RUNNING": 3, + "STOPPING": 4, + "STOPPED": 5, + "SHUTTING_DOWN": 6, + "TERMINATED": 7, + } +) + +func (x Instance_State) Enum() *Instance_State { + p := new(Instance_State) + *p = x + return p +} + +func (x Instance_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Instance_State) Descriptor() protoreflect.EnumDescriptor { + return file_aws_ec2_v1_ec2_proto_enumTypes[2].Descriptor() +} + +func (Instance_State) Type() protoreflect.EnumType { + return &file_aws_ec2_v1_ec2_proto_enumTypes[2] +} + +func (x Instance_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Instance_State.Descriptor instead. +func (Instance_State) EnumDescriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{8, 0} +} + +type AutoscalingGroupSize struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Min uint32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"` + Max uint32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"` + Desired uint32 `protobuf:"varint,3,opt,name=desired,proto3" json:"desired,omitempty"` +} + +func (x *AutoscalingGroupSize) Reset() { + *x = AutoscalingGroupSize{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoscalingGroupSize) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoscalingGroupSize) ProtoMessage() {} + +func (x *AutoscalingGroupSize) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoscalingGroupSize.ProtoReflect.Descriptor instead. +func (*AutoscalingGroupSize) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{0} +} + +func (x *AutoscalingGroupSize) GetMin() uint32 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *AutoscalingGroupSize) GetMax() uint32 { + if x != nil { + return x.Max + } + return 0 +} + +func (x *AutoscalingGroupSize) GetDesired() uint32 { + if x != nil { + return x.Desired + } + return 0 +} + +type ResizeAutoscalingGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + Size *AutoscalingGroupSize `protobuf:"bytes,3,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ResizeAutoscalingGroupRequest) Reset() { + *x = ResizeAutoscalingGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeAutoscalingGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeAutoscalingGroupRequest) ProtoMessage() {} + +func (x *ResizeAutoscalingGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeAutoscalingGroupRequest.ProtoReflect.Descriptor instead. +func (*ResizeAutoscalingGroupRequest) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{1} +} + +func (x *ResizeAutoscalingGroupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ResizeAutoscalingGroupRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *ResizeAutoscalingGroupRequest) GetSize() *AutoscalingGroupSize { + if x != nil { + return x.Size + } + return nil +} + +type ResizeAutoscalingGroupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResizeAutoscalingGroupResponse) Reset() { + *x = ResizeAutoscalingGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeAutoscalingGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeAutoscalingGroupResponse) ProtoMessage() {} + +func (x *ResizeAutoscalingGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeAutoscalingGroupResponse.ProtoReflect.Descriptor instead. +func (*ResizeAutoscalingGroupResponse) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{2} +} + +type AutoscalingGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + // The AZs the ASG is running in. + Zones []string `protobuf:"bytes,3,rep,name=zones,proto3" json:"zones,omitempty"` + Size *AutoscalingGroupSize `protobuf:"bytes,4,opt,name=size,proto3" json:"size,omitempty"` + TerminationPolicies []AutoscalingGroup_TerminationPolicy `protobuf:"varint,5,rep,packed,name=termination_policies,json=terminationPolicies,proto3,enum=clutch.aws.ec2.v1.AutoscalingGroup_TerminationPolicy" json:"termination_policies,omitempty"` + Instances []*AutoscalingGroup_Instance `protobuf:"bytes,6,rep,name=instances,proto3" json:"instances,omitempty"` +} + +func (x *AutoscalingGroup) Reset() { + *x = AutoscalingGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoscalingGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoscalingGroup) ProtoMessage() {} + +func (x *AutoscalingGroup) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoscalingGroup.ProtoReflect.Descriptor instead. +func (*AutoscalingGroup) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{3} +} + +func (x *AutoscalingGroup) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AutoscalingGroup) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *AutoscalingGroup) GetZones() []string { + if x != nil { + return x.Zones + } + return nil +} + +func (x *AutoscalingGroup) GetSize() *AutoscalingGroupSize { + if x != nil { + return x.Size + } + return nil +} + +func (x *AutoscalingGroup) GetTerminationPolicies() []AutoscalingGroup_TerminationPolicy { + if x != nil { + return x.TerminationPolicies + } + return nil +} + +func (x *AutoscalingGroup) GetInstances() []*AutoscalingGroup_Instance { + if x != nil { + return x.Instances + } + return nil +} + +type GetInstanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *GetInstanceRequest) Reset() { + *x = GetInstanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetInstanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInstanceRequest) ProtoMessage() {} + +func (x *GetInstanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInstanceRequest.ProtoReflect.Descriptor instead. +func (*GetInstanceRequest) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{4} +} + +func (x *GetInstanceRequest) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *GetInstanceRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +type GetInstanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` +} + +func (x *GetInstanceResponse) Reset() { + *x = GetInstanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetInstanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInstanceResponse) ProtoMessage() {} + +func (x *GetInstanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInstanceResponse.ProtoReflect.Descriptor instead. +func (*GetInstanceResponse) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{5} +} + +func (x *GetInstanceResponse) GetInstance() *Instance { + if x != nil { + return x.Instance + } + return nil +} + +type TerminateInstanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *TerminateInstanceRequest) Reset() { + *x = TerminateInstanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TerminateInstanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateInstanceRequest) ProtoMessage() {} + +func (x *TerminateInstanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateInstanceRequest.ProtoReflect.Descriptor instead. +func (*TerminateInstanceRequest) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{6} +} + +func (x *TerminateInstanceRequest) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *TerminateInstanceRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +type TerminateInstanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TerminateInstanceResponse) Reset() { + *x = TerminateInstanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TerminateInstanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateInstanceResponse) ProtoMessage() {} + +func (x *TerminateInstanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateInstanceResponse.ProtoReflect.Descriptor instead. +func (*TerminateInstanceResponse) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{7} +} + +type Instance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + State Instance_State `protobuf:"varint,3,opt,name=state,proto3,enum=clutch.aws.ec2.v1.Instance_State" json:"state,omitempty"` + InstanceType string `protobuf:"bytes,4,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"` + PublicIpAddress string `protobuf:"bytes,5,opt,name=public_ip_address,json=publicIpAddress,proto3" json:"public_ip_address,omitempty"` + PrivateIpAddress string `protobuf:"bytes,6,opt,name=private_ip_address,json=privateIpAddress,proto3" json:"private_ip_address,omitempty"` + AvailabilityZone string `protobuf:"bytes,7,opt,name=availability_zone,json=availabilityZone,proto3" json:"availability_zone,omitempty"` + Tags map[string]string `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Instance) Reset() { + *x = Instance{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Instance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Instance) ProtoMessage() {} + +func (x *Instance) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Instance.ProtoReflect.Descriptor instead. +func (*Instance) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{8} +} + +func (x *Instance) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *Instance) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *Instance) GetState() Instance_State { + if x != nil { + return x.State + } + return Instance_UNSPECIFIED +} + +func (x *Instance) GetInstanceType() string { + if x != nil { + return x.InstanceType + } + return "" +} + +func (x *Instance) GetPublicIpAddress() string { + if x != nil { + return x.PublicIpAddress + } + return "" +} + +func (x *Instance) GetPrivateIpAddress() string { + if x != nil { + return x.PrivateIpAddress + } + return "" +} + +func (x *Instance) GetAvailabilityZone() string { + if x != nil { + return x.AvailabilityZone + } + return "" +} + +func (x *Instance) GetTags() map[string]string { + if x != nil { + return x.Tags + } + return nil +} + +type AutoscalingGroup_Instance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Zone string `protobuf:"bytes,2,opt,name=zone,proto3" json:"zone,omitempty"` + LaunchConfigurationName string `protobuf:"bytes,3,opt,name=launch_configuration_name,json=launchConfigurationName,proto3" json:"launch_configuration_name,omitempty"` + Healthy bool `protobuf:"varint,4,opt,name=healthy,proto3" json:"healthy,omitempty"` + LifecycleState AutoscalingGroup_Instance_LifecycleState `protobuf:"varint,5,opt,name=lifecycle_state,json=lifecycleState,proto3,enum=clutch.aws.ec2.v1.AutoscalingGroup_Instance_LifecycleState" json:"lifecycle_state,omitempty"` +} + +func (x *AutoscalingGroup_Instance) Reset() { + *x = AutoscalingGroup_Instance{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoscalingGroup_Instance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoscalingGroup_Instance) ProtoMessage() {} + +func (x *AutoscalingGroup_Instance) ProtoReflect() protoreflect.Message { + mi := &file_aws_ec2_v1_ec2_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoscalingGroup_Instance.ProtoReflect.Descriptor instead. +func (*AutoscalingGroup_Instance) Descriptor() ([]byte, []int) { + return file_aws_ec2_v1_ec2_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *AutoscalingGroup_Instance) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AutoscalingGroup_Instance) GetZone() string { + if x != nil { + return x.Zone + } + return "" +} + +func (x *AutoscalingGroup_Instance) GetLaunchConfigurationName() string { + if x != nil { + return x.LaunchConfigurationName + } + return "" +} + +func (x *AutoscalingGroup_Instance) GetHealthy() bool { + if x != nil { + return x.Healthy + } + return false +} + +func (x *AutoscalingGroup_Instance) GetLifecycleState() AutoscalingGroup_Instance_LifecycleState { + if x != nil { + return x.LifecycleState + } + return AutoscalingGroup_Instance_UNSPECIFIED +} + +var File_aws_ec2_v1_ec2_proto protoreflect.FileDescriptor + +var file_aws_ec2_v1_ec2_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x77, 0x73, 0x2f, 0x65, 0x63, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x63, 0x32, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x14, 0x41, 0x75, + 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, + 0x22, 0xe1, 0x01, 0x0a, 0x1d, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x73, + 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x12, 0x45, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x3b, 0xb2, 0xe1, 0x1c, 0x37, 0x0a, 0x35, 0x0a, + 0x22, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x12, 0x0f, 0x7b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x20, 0x0a, 0x1e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x41, 0x75, + 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe2, 0x08, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x6f, 0x73, + 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x7a, 0x6f, 0x6e, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x7a, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x3b, 0x0a, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x53, 0x69, 0x7a, 0x65, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x68, 0x0a, 0x14, 0x74, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, + 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x54, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, + 0x13, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x69, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, + 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x1a, 0x80, 0x04, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, + 0x65, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x64, 0x0a, 0x0f, 0x6c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x3b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, + 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x6c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x93, 0x02, + 0x0a, 0x0e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x50, + 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x10, 0x03, 0x12, 0x13, 0x0a, + 0x0f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x45, 0x44, + 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x51, 0x55, 0x41, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x4e, 0x45, + 0x44, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4e, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, + 0x45, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x49, + 0x4e, 0x47, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, + 0x49, 0x4e, 0x47, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x10, 0x08, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, + 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x45, + 0x44, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, + 0x44, 0x10, 0x0a, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x54, 0x41, 0x43, 0x48, 0x49, 0x4e, 0x47, + 0x10, 0x0b, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, 0x54, 0x41, 0x43, 0x48, 0x45, 0x44, 0x10, 0x0c, + 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x41, + 0x4e, 0x44, 0x42, 0x59, 0x10, 0x0d, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x42, + 0x59, 0x10, 0x0e, 0x22, 0xd8, 0x01, 0x0a, 0x11, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x4c, 0x44, 0x45, 0x53, + 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, + 0x4e, 0x45, 0x57, 0x45, 0x53, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x10, + 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x4f, 0x4c, 0x44, 0x45, 0x53, 0x54, 0x5f, 0x4c, 0x41, 0x55, 0x4e, + 0x43, 0x48, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x4f, + 0x5f, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x48, 0x4f, 0x55, 0x52, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x4c, 0x44, + 0x45, 0x53, 0x54, 0x5f, 0x4c, 0x41, 0x55, 0x4e, 0x43, 0x48, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4c, + 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x4c, 0x4f, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x10, 0x08, 0x3a, 0x3b, + 0xb2, 0xe1, 0x1c, 0x37, 0x0a, 0x35, 0x0a, 0x22, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, + 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, + 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0f, 0x7b, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x9b, 0x01, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, + 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0xb2, + 0xe1, 0x1c, 0x36, 0x0a, 0x34, 0x0a, 0x1a, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, + 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x16, 0x7b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x22, 0x5e, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x37, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, + 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x0e, 0xaa, 0xe1, 0x1c, 0x0a, 0x0a, + 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x18, 0x54, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x20, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x3a, 0x3a, 0xb2, 0xe1, 0x1c, 0x36, 0x0a, 0x34, 0x0a, 0x1a, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x7b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, + 0x7b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x22, 0x1b, 0x0a, + 0x19, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd7, 0x04, 0x0a, 0x08, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x12, 0x37, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, + 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, + 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, + 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x2e, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, + 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7d, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, + 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, + 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, + 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, + 0x50, 0x45, 0x44, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x48, 0x55, 0x54, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x45, 0x52, 0x4d, + 0x49, 0x4e, 0x41, 0x54, 0x45, 0x44, 0x10, 0x07, 0x3a, 0x3a, 0xb2, 0xe1, 0x1c, 0x36, 0x0a, 0x34, + 0x0a, 0x1a, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x7b, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x7d, 0x32, 0xe7, 0x03, 0x0a, 0x06, 0x45, 0x43, 0x32, 0x41, 0x50, 0x49, 0x12, + 0x86, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x25, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2f, + 0x65, 0x63, 0x32, 0x2f, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3a, + 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0x9e, 0x01, 0x0a, 0x11, 0x54, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2b, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x22, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x65, 0x63, 0x32, 0x2f, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x04, 0x12, 0xb2, 0x01, 0x0a, 0x16, 0x52, 0x65, + 0x73, 0x69, 0x7a, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x12, 0x30, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, + 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x41, + 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x77, 0x73, 0x2e, 0x65, 0x63, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, + 0x65, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x27, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x65, 0x63, 0x32, 0x2f, 0x72, + 0x65, 0x73, 0x69, 0x7a, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x03, 0x42, 0x07, + 0x5a, 0x05, 0x65, 0x63, 0x32, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aws_ec2_v1_ec2_proto_rawDescOnce sync.Once + file_aws_ec2_v1_ec2_proto_rawDescData = file_aws_ec2_v1_ec2_proto_rawDesc +) + +func file_aws_ec2_v1_ec2_proto_rawDescGZIP() []byte { + file_aws_ec2_v1_ec2_proto_rawDescOnce.Do(func() { + file_aws_ec2_v1_ec2_proto_rawDescData = protoimpl.X.CompressGZIP(file_aws_ec2_v1_ec2_proto_rawDescData) + }) + return file_aws_ec2_v1_ec2_proto_rawDescData +} + +var file_aws_ec2_v1_ec2_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_aws_ec2_v1_ec2_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_aws_ec2_v1_ec2_proto_goTypes = []interface{}{ + (AutoscalingGroup_TerminationPolicy)(0), // 0: clutch.aws.ec2.v1.AutoscalingGroup.TerminationPolicy + (AutoscalingGroup_Instance_LifecycleState)(0), // 1: clutch.aws.ec2.v1.AutoscalingGroup.Instance.LifecycleState + (Instance_State)(0), // 2: clutch.aws.ec2.v1.Instance.State + (*AutoscalingGroupSize)(nil), // 3: clutch.aws.ec2.v1.AutoscalingGroupSize + (*ResizeAutoscalingGroupRequest)(nil), // 4: clutch.aws.ec2.v1.ResizeAutoscalingGroupRequest + (*ResizeAutoscalingGroupResponse)(nil), // 5: clutch.aws.ec2.v1.ResizeAutoscalingGroupResponse + (*AutoscalingGroup)(nil), // 6: clutch.aws.ec2.v1.AutoscalingGroup + (*GetInstanceRequest)(nil), // 7: clutch.aws.ec2.v1.GetInstanceRequest + (*GetInstanceResponse)(nil), // 8: clutch.aws.ec2.v1.GetInstanceResponse + (*TerminateInstanceRequest)(nil), // 9: clutch.aws.ec2.v1.TerminateInstanceRequest + (*TerminateInstanceResponse)(nil), // 10: clutch.aws.ec2.v1.TerminateInstanceResponse + (*Instance)(nil), // 11: clutch.aws.ec2.v1.Instance + (*AutoscalingGroup_Instance)(nil), // 12: clutch.aws.ec2.v1.AutoscalingGroup.Instance + nil, // 13: clutch.aws.ec2.v1.Instance.TagsEntry +} +var file_aws_ec2_v1_ec2_proto_depIdxs = []int32{ + 3, // 0: clutch.aws.ec2.v1.ResizeAutoscalingGroupRequest.size:type_name -> clutch.aws.ec2.v1.AutoscalingGroupSize + 3, // 1: clutch.aws.ec2.v1.AutoscalingGroup.size:type_name -> clutch.aws.ec2.v1.AutoscalingGroupSize + 0, // 2: clutch.aws.ec2.v1.AutoscalingGroup.termination_policies:type_name -> clutch.aws.ec2.v1.AutoscalingGroup.TerminationPolicy + 12, // 3: clutch.aws.ec2.v1.AutoscalingGroup.instances:type_name -> clutch.aws.ec2.v1.AutoscalingGroup.Instance + 11, // 4: clutch.aws.ec2.v1.GetInstanceResponse.instance:type_name -> clutch.aws.ec2.v1.Instance + 2, // 5: clutch.aws.ec2.v1.Instance.state:type_name -> clutch.aws.ec2.v1.Instance.State + 13, // 6: clutch.aws.ec2.v1.Instance.tags:type_name -> clutch.aws.ec2.v1.Instance.TagsEntry + 1, // 7: clutch.aws.ec2.v1.AutoscalingGroup.Instance.lifecycle_state:type_name -> clutch.aws.ec2.v1.AutoscalingGroup.Instance.LifecycleState + 7, // 8: clutch.aws.ec2.v1.EC2API.GetInstance:input_type -> clutch.aws.ec2.v1.GetInstanceRequest + 9, // 9: clutch.aws.ec2.v1.EC2API.TerminateInstance:input_type -> clutch.aws.ec2.v1.TerminateInstanceRequest + 4, // 10: clutch.aws.ec2.v1.EC2API.ResizeAutoscalingGroup:input_type -> clutch.aws.ec2.v1.ResizeAutoscalingGroupRequest + 8, // 11: clutch.aws.ec2.v1.EC2API.GetInstance:output_type -> clutch.aws.ec2.v1.GetInstanceResponse + 10, // 12: clutch.aws.ec2.v1.EC2API.TerminateInstance:output_type -> clutch.aws.ec2.v1.TerminateInstanceResponse + 5, // 13: clutch.aws.ec2.v1.EC2API.ResizeAutoscalingGroup:output_type -> clutch.aws.ec2.v1.ResizeAutoscalingGroupResponse + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_aws_ec2_v1_ec2_proto_init() } +func file_aws_ec2_v1_ec2_proto_init() { + if File_aws_ec2_v1_ec2_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_aws_ec2_v1_ec2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoscalingGroupSize); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeAutoscalingGroupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeAutoscalingGroupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoscalingGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetInstanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetInstanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminateInstanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TerminateInstanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Instance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_ec2_v1_ec2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoscalingGroup_Instance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aws_ec2_v1_ec2_proto_rawDesc, + NumEnums: 3, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_aws_ec2_v1_ec2_proto_goTypes, + DependencyIndexes: file_aws_ec2_v1_ec2_proto_depIdxs, + EnumInfos: file_aws_ec2_v1_ec2_proto_enumTypes, + MessageInfos: file_aws_ec2_v1_ec2_proto_msgTypes, + }.Build() + File_aws_ec2_v1_ec2_proto = out.File + file_aws_ec2_v1_ec2_proto_rawDesc = nil + file_aws_ec2_v1_ec2_proto_goTypes = nil + file_aws_ec2_v1_ec2_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// EC2APIClient is the client API for EC2API service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type EC2APIClient interface { + GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*GetInstanceResponse, error) + TerminateInstance(ctx context.Context, in *TerminateInstanceRequest, opts ...grpc.CallOption) (*TerminateInstanceResponse, error) + ResizeAutoscalingGroup(ctx context.Context, in *ResizeAutoscalingGroupRequest, opts ...grpc.CallOption) (*ResizeAutoscalingGroupResponse, error) +} + +type eC2APIClient struct { + cc grpc.ClientConnInterface +} + +func NewEC2APIClient(cc grpc.ClientConnInterface) EC2APIClient { + return &eC2APIClient{cc} +} + +func (c *eC2APIClient) GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*GetInstanceResponse, error) { + out := new(GetInstanceResponse) + err := c.cc.Invoke(ctx, "/clutch.aws.ec2.v1.EC2API/GetInstance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eC2APIClient) TerminateInstance(ctx context.Context, in *TerminateInstanceRequest, opts ...grpc.CallOption) (*TerminateInstanceResponse, error) { + out := new(TerminateInstanceResponse) + err := c.cc.Invoke(ctx, "/clutch.aws.ec2.v1.EC2API/TerminateInstance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eC2APIClient) ResizeAutoscalingGroup(ctx context.Context, in *ResizeAutoscalingGroupRequest, opts ...grpc.CallOption) (*ResizeAutoscalingGroupResponse, error) { + out := new(ResizeAutoscalingGroupResponse) + err := c.cc.Invoke(ctx, "/clutch.aws.ec2.v1.EC2API/ResizeAutoscalingGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EC2APIServer is the server API for EC2API service. +type EC2APIServer interface { + GetInstance(context.Context, *GetInstanceRequest) (*GetInstanceResponse, error) + TerminateInstance(context.Context, *TerminateInstanceRequest) (*TerminateInstanceResponse, error) + ResizeAutoscalingGroup(context.Context, *ResizeAutoscalingGroupRequest) (*ResizeAutoscalingGroupResponse, error) +} + +// UnimplementedEC2APIServer can be embedded to have forward compatible implementations. +type UnimplementedEC2APIServer struct { +} + +func (*UnimplementedEC2APIServer) GetInstance(context.Context, *GetInstanceRequest) (*GetInstanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInstance not implemented") +} +func (*UnimplementedEC2APIServer) TerminateInstance(context.Context, *TerminateInstanceRequest) (*TerminateInstanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TerminateInstance not implemented") +} +func (*UnimplementedEC2APIServer) ResizeAutoscalingGroup(context.Context, *ResizeAutoscalingGroupRequest) (*ResizeAutoscalingGroupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResizeAutoscalingGroup not implemented") +} + +func RegisterEC2APIServer(s *grpc.Server, srv EC2APIServer) { + s.RegisterService(&_EC2API_serviceDesc, srv) +} + +func _EC2API_GetInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EC2APIServer).GetInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.aws.ec2.v1.EC2API/GetInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EC2APIServer).GetInstance(ctx, req.(*GetInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EC2API_TerminateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TerminateInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EC2APIServer).TerminateInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.aws.ec2.v1.EC2API/TerminateInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EC2APIServer).TerminateInstance(ctx, req.(*TerminateInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EC2API_ResizeAutoscalingGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResizeAutoscalingGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EC2APIServer).ResizeAutoscalingGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.aws.ec2.v1.EC2API/ResizeAutoscalingGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EC2APIServer).ResizeAutoscalingGroup(ctx, req.(*ResizeAutoscalingGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _EC2API_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.aws.ec2.v1.EC2API", + HandlerType: (*EC2APIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInstance", + Handler: _EC2API_GetInstance_Handler, + }, + { + MethodName: "TerminateInstance", + Handler: _EC2API_TerminateInstance_Handler, + }, + { + MethodName: "ResizeAutoscalingGroup", + Handler: _EC2API_ResizeAutoscalingGroup_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "aws/ec2/v1/ec2.proto", +} diff --git a/backend/api/aws/ec2/v1/ec2.pb.gw.go b/backend/api/aws/ec2/v1/ec2.pb.gw.go new file mode 100644 index 0000000000..2b88ff4ceb --- /dev/null +++ b/backend/api/aws/ec2/v1/ec2.pb.gw.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: aws/ec2/v1/ec2.proto + +/* +Package ec2v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package ec2v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_EC2API_GetInstance_0(ctx context.Context, marshaler runtime.Marshaler, client EC2APIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetInstanceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetInstance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_EC2API_GetInstance_0(ctx context.Context, marshaler runtime.Marshaler, server EC2APIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetInstanceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetInstance(ctx, &protoReq) + return msg, metadata, err + +} + +func request_EC2API_TerminateInstance_0(ctx context.Context, marshaler runtime.Marshaler, client EC2APIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TerminateInstanceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TerminateInstance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_EC2API_TerminateInstance_0(ctx context.Context, marshaler runtime.Marshaler, server EC2APIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TerminateInstanceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TerminateInstance(ctx, &protoReq) + return msg, metadata, err + +} + +func request_EC2API_ResizeAutoscalingGroup_0(ctx context.Context, marshaler runtime.Marshaler, client EC2APIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResizeAutoscalingGroupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ResizeAutoscalingGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_EC2API_ResizeAutoscalingGroup_0(ctx context.Context, marshaler runtime.Marshaler, server EC2APIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResizeAutoscalingGroupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ResizeAutoscalingGroup(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterEC2APIHandlerServer registers the http handlers for service EC2API to "mux". +// UnaryRPC :call EC2APIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEC2APIHandlerFromEndpoint instead. +func RegisterEC2APIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EC2APIServer) error { + + mux.Handle("POST", pattern_EC2API_GetInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/GetInstance") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_EC2API_GetInstance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_GetInstance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_EC2API_TerminateInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/TerminateInstance") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_EC2API_TerminateInstance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_TerminateInstance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_EC2API_ResizeAutoscalingGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/ResizeAutoscalingGroup") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_EC2API_ResizeAutoscalingGroup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_ResizeAutoscalingGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterEC2APIHandlerFromEndpoint is same as RegisterEC2APIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterEC2APIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterEC2APIHandler(ctx, mux, conn) +} + +// RegisterEC2APIHandler registers the http handlers for service EC2API to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterEC2APIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterEC2APIHandlerClient(ctx, mux, NewEC2APIClient(conn)) +} + +// RegisterEC2APIHandlerClient registers the http handlers for service EC2API +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EC2APIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EC2APIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "EC2APIClient" to call the correct interceptors. +func RegisterEC2APIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EC2APIClient) error { + + mux.Handle("POST", pattern_EC2API_GetInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/GetInstance") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EC2API_GetInstance_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_GetInstance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_EC2API_TerminateInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/TerminateInstance") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EC2API_TerminateInstance_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_TerminateInstance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_EC2API_ResizeAutoscalingGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.aws.ec2.v1.EC2API/ResizeAutoscalingGroup") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EC2API_ResizeAutoscalingGroup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EC2API_ResizeAutoscalingGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_EC2API_GetInstance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "aws", "ec2", "getInstance"}, "")) + + pattern_EC2API_TerminateInstance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "aws", "ec2", "terminateInstance"}, "")) + + pattern_EC2API_ResizeAutoscalingGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "aws", "ec2", "resizeAutoscalingGroup"}, "")) +) + +var ( + forward_EC2API_GetInstance_0 = runtime.ForwardResponseMessage + + forward_EC2API_TerminateInstance_0 = runtime.ForwardResponseMessage + + forward_EC2API_ResizeAutoscalingGroup_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/aws/ec2/v1/ec2.pb.validate.go b/backend/api/aws/ec2/v1/ec2.pb.validate.go new file mode 100644 index 0000000000..c2cda07475 --- /dev/null +++ b/backend/api/aws/ec2/v1/ec2.pb.validate.go @@ -0,0 +1,834 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: aws/ec2/v1/ec2.proto + +package ec2v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _ec_2_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on AutoscalingGroupSize with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AutoscalingGroupSize) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Min + + // no validation rules for Max + + // no validation rules for Desired + + return nil +} + +// AutoscalingGroupSizeValidationError is the validation error returned by +// AutoscalingGroupSize.Validate if the designated constraints aren't met. +type AutoscalingGroupSizeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AutoscalingGroupSizeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AutoscalingGroupSizeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AutoscalingGroupSizeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AutoscalingGroupSizeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AutoscalingGroupSizeValidationError) ErrorName() string { + return "AutoscalingGroupSizeValidationError" +} + +// Error satisfies the builtin error interface +func (e AutoscalingGroupSizeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAutoscalingGroupSize.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AutoscalingGroupSizeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AutoscalingGroupSizeValidationError{} + +// Validate checks the field values on ResizeAutoscalingGroupRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ResizeAutoscalingGroupRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ResizeAutoscalingGroupRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetRegion()) < 1 { + return ResizeAutoscalingGroupRequestValidationError{ + field: "Region", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetSize() == nil { + return ResizeAutoscalingGroupRequestValidationError{ + field: "Size", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetSize()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResizeAutoscalingGroupRequestValidationError{ + field: "Size", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ResizeAutoscalingGroupRequestValidationError is the validation error +// returned by ResizeAutoscalingGroupRequest.Validate if the designated +// constraints aren't met. +type ResizeAutoscalingGroupRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResizeAutoscalingGroupRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResizeAutoscalingGroupRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResizeAutoscalingGroupRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResizeAutoscalingGroupRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResizeAutoscalingGroupRequestValidationError) ErrorName() string { + return "ResizeAutoscalingGroupRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ResizeAutoscalingGroupRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResizeAutoscalingGroupRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResizeAutoscalingGroupRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResizeAutoscalingGroupRequestValidationError{} + +// Validate checks the field values on ResizeAutoscalingGroupResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ResizeAutoscalingGroupResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// ResizeAutoscalingGroupResponseValidationError is the validation error +// returned by ResizeAutoscalingGroupResponse.Validate if the designated +// constraints aren't met. +type ResizeAutoscalingGroupResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResizeAutoscalingGroupResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResizeAutoscalingGroupResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResizeAutoscalingGroupResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResizeAutoscalingGroupResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResizeAutoscalingGroupResponseValidationError) ErrorName() string { + return "ResizeAutoscalingGroupResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ResizeAutoscalingGroupResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResizeAutoscalingGroupResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResizeAutoscalingGroupResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResizeAutoscalingGroupResponseValidationError{} + +// Validate checks the field values on AutoscalingGroup with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AutoscalingGroup) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Region + + if v, ok := interface{}(m.GetSize()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AutoscalingGroupValidationError{ + field: "Size", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetInstances() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AutoscalingGroupValidationError{ + field: fmt.Sprintf("Instances[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// AutoscalingGroupValidationError is the validation error returned by +// AutoscalingGroup.Validate if the designated constraints aren't met. +type AutoscalingGroupValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AutoscalingGroupValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AutoscalingGroupValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AutoscalingGroupValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AutoscalingGroupValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AutoscalingGroupValidationError) ErrorName() string { return "AutoscalingGroupValidationError" } + +// Error satisfies the builtin error interface +func (e AutoscalingGroupValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAutoscalingGroup.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AutoscalingGroupValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AutoscalingGroupValidationError{} + +// Validate checks the field values on GetInstanceRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetInstanceRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetInstanceId()) < 1 { + return GetInstanceRequestValidationError{ + field: "InstanceId", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetRegion()) < 1 { + return GetInstanceRequestValidationError{ + field: "Region", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// GetInstanceRequestValidationError is the validation error returned by +// GetInstanceRequest.Validate if the designated constraints aren't met. +type GetInstanceRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetInstanceRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetInstanceRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetInstanceRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetInstanceRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetInstanceRequestValidationError) ErrorName() string { + return "GetInstanceRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetInstanceRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetInstanceRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetInstanceRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetInstanceRequestValidationError{} + +// Validate checks the field values on GetInstanceResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetInstanceResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetInstance()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetInstanceResponseValidationError{ + field: "Instance", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// GetInstanceResponseValidationError is the validation error returned by +// GetInstanceResponse.Validate if the designated constraints aren't met. +type GetInstanceResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetInstanceResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetInstanceResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetInstanceResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetInstanceResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetInstanceResponseValidationError) ErrorName() string { + return "GetInstanceResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetInstanceResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetInstanceResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetInstanceResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetInstanceResponseValidationError{} + +// Validate checks the field values on TerminateInstanceRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TerminateInstanceRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetInstanceId()) < 1 { + return TerminateInstanceRequestValidationError{ + field: "InstanceId", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetRegion()) < 1 { + return TerminateInstanceRequestValidationError{ + field: "Region", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// TerminateInstanceRequestValidationError is the validation error returned by +// TerminateInstanceRequest.Validate if the designated constraints aren't met. +type TerminateInstanceRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TerminateInstanceRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TerminateInstanceRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TerminateInstanceRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TerminateInstanceRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TerminateInstanceRequestValidationError) ErrorName() string { + return "TerminateInstanceRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e TerminateInstanceRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTerminateInstanceRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TerminateInstanceRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TerminateInstanceRequestValidationError{} + +// Validate checks the field values on TerminateInstanceResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TerminateInstanceResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// TerminateInstanceResponseValidationError is the validation error returned by +// TerminateInstanceResponse.Validate if the designated constraints aren't met. +type TerminateInstanceResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TerminateInstanceResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TerminateInstanceResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TerminateInstanceResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TerminateInstanceResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TerminateInstanceResponseValidationError) ErrorName() string { + return "TerminateInstanceResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e TerminateInstanceResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTerminateInstanceResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TerminateInstanceResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TerminateInstanceResponseValidationError{} + +// Validate checks the field values on Instance with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Instance) Validate() error { + if m == nil { + return nil + } + + // no validation rules for InstanceId + + // no validation rules for Region + + // no validation rules for State + + // no validation rules for InstanceType + + // no validation rules for PublicIpAddress + + // no validation rules for PrivateIpAddress + + // no validation rules for AvailabilityZone + + // no validation rules for Tags + + return nil +} + +// InstanceValidationError is the validation error returned by +// Instance.Validate if the designated constraints aren't met. +type InstanceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e InstanceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e InstanceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e InstanceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e InstanceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e InstanceValidationError) ErrorName() string { return "InstanceValidationError" } + +// Error satisfies the builtin error interface +func (e InstanceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInstance.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = InstanceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = InstanceValidationError{} + +// Validate checks the field values on AutoscalingGroup_Instance with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AutoscalingGroup_Instance) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + // no validation rules for Zone + + // no validation rules for LaunchConfigurationName + + // no validation rules for Healthy + + // no validation rules for LifecycleState + + return nil +} + +// AutoscalingGroup_InstanceValidationError is the validation error returned by +// AutoscalingGroup_Instance.Validate if the designated constraints aren't met. +type AutoscalingGroup_InstanceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AutoscalingGroup_InstanceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AutoscalingGroup_InstanceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AutoscalingGroup_InstanceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AutoscalingGroup_InstanceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AutoscalingGroup_InstanceValidationError) ErrorName() string { + return "AutoscalingGroup_InstanceValidationError" +} + +// Error satisfies the builtin error interface +func (e AutoscalingGroup_InstanceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAutoscalingGroup_Instance.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AutoscalingGroup_InstanceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AutoscalingGroup_InstanceValidationError{} diff --git a/backend/api/aws/kinesis/v1/kinesis.pb.go b/backend/api/aws/kinesis/v1/kinesis.pb.go new file mode 100644 index 0000000000..4913f3dbd8 --- /dev/null +++ b/backend/api/aws/kinesis/v1/kinesis.pb.go @@ -0,0 +1,599 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: aws/kinesis/v1/kinesis.proto + +package kinesisv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type GetStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StreamName string `protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *GetStreamRequest) Reset() { + *x = GetStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStreamRequest) ProtoMessage() {} + +func (x *GetStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStreamRequest.ProtoReflect.Descriptor instead. +func (*GetStreamRequest) Descriptor() ([]byte, []int) { + return file_aws_kinesis_v1_kinesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GetStreamRequest) GetStreamName() string { + if x != nil { + return x.StreamName + } + return "" +} + +func (x *GetStreamRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +type GetStreamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stream *Stream `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"` +} + +func (x *GetStreamResponse) Reset() { + *x = GetStreamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStreamResponse) ProtoMessage() {} + +func (x *GetStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStreamResponse.ProtoReflect.Descriptor instead. +func (*GetStreamResponse) Descriptor() ([]byte, []int) { + return file_aws_kinesis_v1_kinesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GetStreamResponse) GetStream() *Stream { + if x != nil { + return x.Stream + } + return nil +} + +type UpdateShardCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StreamName string `protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + TargetShardCount uint32 `protobuf:"varint,3,opt,name=target_shard_count,json=targetShardCount,proto3" json:"target_shard_count,omitempty"` +} + +func (x *UpdateShardCountRequest) Reset() { + *x = UpdateShardCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateShardCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateShardCountRequest) ProtoMessage() {} + +func (x *UpdateShardCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateShardCountRequest.ProtoReflect.Descriptor instead. +func (*UpdateShardCountRequest) Descriptor() ([]byte, []int) { + return file_aws_kinesis_v1_kinesis_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateShardCountRequest) GetStreamName() string { + if x != nil { + return x.StreamName + } + return "" +} + +func (x *UpdateShardCountRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *UpdateShardCountRequest) GetTargetShardCount() uint32 { + if x != nil { + return x.TargetShardCount + } + return 0 +} + +type UpdateShardCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateShardCountResponse) Reset() { + *x = UpdateShardCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateShardCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateShardCountResponse) ProtoMessage() {} + +func (x *UpdateShardCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateShardCountResponse.ProtoReflect.Descriptor instead. +func (*UpdateShardCountResponse) Descriptor() ([]byte, []int) { + return file_aws_kinesis_v1_kinesis_proto_rawDescGZIP(), []int{3} +} + +type Stream struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StreamName string `protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + CurrentShardCount uint32 `protobuf:"varint,3,opt,name=current_shard_count,json=currentShardCount,proto3" json:"current_shard_count,omitempty"` +} + +func (x *Stream) Reset() { + *x = Stream{} + if protoimpl.UnsafeEnabled { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stream) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stream) ProtoMessage() {} + +func (x *Stream) ProtoReflect() protoreflect.Message { + mi := &file_aws_kinesis_v1_kinesis_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stream.ProtoReflect.Descriptor instead. +func (*Stream) Descriptor() ([]byte, []int) { + return file_aws_kinesis_v1_kinesis_proto_rawDescGZIP(), []int{4} +} + +func (x *Stream) GetStreamName() string { + if x != nil { + return x.StreamName + } + return "" +} + +func (x *Stream) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *Stream) GetCurrentShardCount() uint32 { + if x != nil { + return x.CurrentShardCount + } + return 0 +} + +var File_aws_kinesis_v1_kinesis_proto protoreflect.FileDescriptor + +var file_aws_kinesis_v1_kinesis_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x61, 0x77, 0x73, 0x2f, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2f, 0x76, 0x31, + 0x2f, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x22, 0x58, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x35, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x06, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x0c, 0xaa, 0xe1, 0x1c, 0x08, 0x0a, 0x06, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x22, 0x80, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1f, + 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x3c, 0xb2, 0xe1, 0x1c, 0x38, 0x0a, 0x36, 0x0a, + 0x1c, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x7b, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x32, 0xc2, 0x02, 0x0a, 0x0a, 0x4b, 0x69, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x41, 0x50, 0x49, 0x12, 0x8a, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, + 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x19, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2f, 0x67, + 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, + 0x02, 0x12, 0xa6, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, + 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x61, 0x77, 0x73, 0x2e, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x22, + 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x03, 0x42, 0x0b, 0x5a, 0x09, 0x6b, 0x69, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aws_kinesis_v1_kinesis_proto_rawDescOnce sync.Once + file_aws_kinesis_v1_kinesis_proto_rawDescData = file_aws_kinesis_v1_kinesis_proto_rawDesc +) + +func file_aws_kinesis_v1_kinesis_proto_rawDescGZIP() []byte { + file_aws_kinesis_v1_kinesis_proto_rawDescOnce.Do(func() { + file_aws_kinesis_v1_kinesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_aws_kinesis_v1_kinesis_proto_rawDescData) + }) + return file_aws_kinesis_v1_kinesis_proto_rawDescData +} + +var file_aws_kinesis_v1_kinesis_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_aws_kinesis_v1_kinesis_proto_goTypes = []interface{}{ + (*GetStreamRequest)(nil), // 0: clutch.aws.kinesis.v1.GetStreamRequest + (*GetStreamResponse)(nil), // 1: clutch.aws.kinesis.v1.GetStreamResponse + (*UpdateShardCountRequest)(nil), // 2: clutch.aws.kinesis.v1.UpdateShardCountRequest + (*UpdateShardCountResponse)(nil), // 3: clutch.aws.kinesis.v1.UpdateShardCountResponse + (*Stream)(nil), // 4: clutch.aws.kinesis.v1.Stream +} +var file_aws_kinesis_v1_kinesis_proto_depIdxs = []int32{ + 4, // 0: clutch.aws.kinesis.v1.GetStreamResponse.stream:type_name -> clutch.aws.kinesis.v1.Stream + 0, // 1: clutch.aws.kinesis.v1.KinesisAPI.GetStream:input_type -> clutch.aws.kinesis.v1.GetStreamRequest + 2, // 2: clutch.aws.kinesis.v1.KinesisAPI.UpdateShardCount:input_type -> clutch.aws.kinesis.v1.UpdateShardCountRequest + 1, // 3: clutch.aws.kinesis.v1.KinesisAPI.GetStream:output_type -> clutch.aws.kinesis.v1.GetStreamResponse + 3, // 4: clutch.aws.kinesis.v1.KinesisAPI.UpdateShardCount:output_type -> clutch.aws.kinesis.v1.UpdateShardCountResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_aws_kinesis_v1_kinesis_proto_init() } +func file_aws_kinesis_v1_kinesis_proto_init() { + if File_aws_kinesis_v1_kinesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_aws_kinesis_v1_kinesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_kinesis_v1_kinesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStreamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_kinesis_v1_kinesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateShardCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_kinesis_v1_kinesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateShardCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aws_kinesis_v1_kinesis_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stream); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aws_kinesis_v1_kinesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_aws_kinesis_v1_kinesis_proto_goTypes, + DependencyIndexes: file_aws_kinesis_v1_kinesis_proto_depIdxs, + MessageInfos: file_aws_kinesis_v1_kinesis_proto_msgTypes, + }.Build() + File_aws_kinesis_v1_kinesis_proto = out.File + file_aws_kinesis_v1_kinesis_proto_rawDesc = nil + file_aws_kinesis_v1_kinesis_proto_goTypes = nil + file_aws_kinesis_v1_kinesis_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// KinesisAPIClient is the client API for KinesisAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type KinesisAPIClient interface { + GetStream(ctx context.Context, in *GetStreamRequest, opts ...grpc.CallOption) (*GetStreamResponse, error) + UpdateShardCount(ctx context.Context, in *UpdateShardCountRequest, opts ...grpc.CallOption) (*UpdateShardCountResponse, error) +} + +type kinesisAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewKinesisAPIClient(cc grpc.ClientConnInterface) KinesisAPIClient { + return &kinesisAPIClient{cc} +} + +func (c *kinesisAPIClient) GetStream(ctx context.Context, in *GetStreamRequest, opts ...grpc.CallOption) (*GetStreamResponse, error) { + out := new(GetStreamResponse) + err := c.cc.Invoke(ctx, "/clutch.aws.kinesis.v1.KinesisAPI/GetStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kinesisAPIClient) UpdateShardCount(ctx context.Context, in *UpdateShardCountRequest, opts ...grpc.CallOption) (*UpdateShardCountResponse, error) { + out := new(UpdateShardCountResponse) + err := c.cc.Invoke(ctx, "/clutch.aws.kinesis.v1.KinesisAPI/UpdateShardCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// KinesisAPIServer is the server API for KinesisAPI service. +type KinesisAPIServer interface { + GetStream(context.Context, *GetStreamRequest) (*GetStreamResponse, error) + UpdateShardCount(context.Context, *UpdateShardCountRequest) (*UpdateShardCountResponse, error) +} + +// UnimplementedKinesisAPIServer can be embedded to have forward compatible implementations. +type UnimplementedKinesisAPIServer struct { +} + +func (*UnimplementedKinesisAPIServer) GetStream(context.Context, *GetStreamRequest) (*GetStreamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStream not implemented") +} +func (*UnimplementedKinesisAPIServer) UpdateShardCount(context.Context, *UpdateShardCountRequest) (*UpdateShardCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateShardCount not implemented") +} + +func RegisterKinesisAPIServer(s *grpc.Server, srv KinesisAPIServer) { + s.RegisterService(&_KinesisAPI_serviceDesc, srv) +} + +func _KinesisAPI_GetStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KinesisAPIServer).GetStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.aws.kinesis.v1.KinesisAPI/GetStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KinesisAPIServer).GetStream(ctx, req.(*GetStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KinesisAPI_UpdateShardCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateShardCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KinesisAPIServer).UpdateShardCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.aws.kinesis.v1.KinesisAPI/UpdateShardCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KinesisAPIServer).UpdateShardCount(ctx, req.(*UpdateShardCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _KinesisAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.aws.kinesis.v1.KinesisAPI", + HandlerType: (*KinesisAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetStream", + Handler: _KinesisAPI_GetStream_Handler, + }, + { + MethodName: "UpdateShardCount", + Handler: _KinesisAPI_UpdateShardCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "aws/kinesis/v1/kinesis.proto", +} diff --git a/backend/api/aws/kinesis/v1/kinesis.pb.gw.go b/backend/api/aws/kinesis/v1/kinesis.pb.gw.go new file mode 100644 index 0000000000..a26c05f2a6 --- /dev/null +++ b/backend/api/aws/kinesis/v1/kinesis.pb.gw.go @@ -0,0 +1,248 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: aws/kinesis/v1/kinesis.proto + +/* +Package kinesisv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package kinesisv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_KinesisAPI_GetStream_0(ctx context.Context, marshaler runtime.Marshaler, client KinesisAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KinesisAPI_GetStream_0(ctx context.Context, marshaler runtime.Marshaler, server KinesisAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetStream(ctx, &protoReq) + return msg, metadata, err + +} + +func request_KinesisAPI_UpdateShardCount_0(ctx context.Context, marshaler runtime.Marshaler, client KinesisAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateShardCountRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateShardCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KinesisAPI_UpdateShardCount_0(ctx context.Context, marshaler runtime.Marshaler, server KinesisAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateShardCountRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateShardCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterKinesisAPIHandlerServer registers the http handlers for service KinesisAPI to "mux". +// UnaryRPC :call KinesisAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterKinesisAPIHandlerFromEndpoint instead. +func RegisterKinesisAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KinesisAPIServer) error { + + mux.Handle("POST", pattern_KinesisAPI_GetStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.aws.kinesis.v1.KinesisAPI/GetStream") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KinesisAPI_GetStream_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KinesisAPI_GetStream_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KinesisAPI_UpdateShardCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.aws.kinesis.v1.KinesisAPI/UpdateShardCount") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KinesisAPI_UpdateShardCount_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KinesisAPI_UpdateShardCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterKinesisAPIHandlerFromEndpoint is same as RegisterKinesisAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterKinesisAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterKinesisAPIHandler(ctx, mux, conn) +} + +// RegisterKinesisAPIHandler registers the http handlers for service KinesisAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterKinesisAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterKinesisAPIHandlerClient(ctx, mux, NewKinesisAPIClient(conn)) +} + +// RegisterKinesisAPIHandlerClient registers the http handlers for service KinesisAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "KinesisAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "KinesisAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "KinesisAPIClient" to call the correct interceptors. +func RegisterKinesisAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client KinesisAPIClient) error { + + mux.Handle("POST", pattern_KinesisAPI_GetStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.aws.kinesis.v1.KinesisAPI/GetStream") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KinesisAPI_GetStream_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KinesisAPI_GetStream_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KinesisAPI_UpdateShardCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.aws.kinesis.v1.KinesisAPI/UpdateShardCount") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KinesisAPI_UpdateShardCount_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KinesisAPI_UpdateShardCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_KinesisAPI_GetStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "aws", "kinesis", "getStream"}, "")) + + pattern_KinesisAPI_UpdateShardCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "aws", "kinesis", "updateShardCount"}, "")) +) + +var ( + forward_KinesisAPI_GetStream_0 = runtime.ForwardResponseMessage + + forward_KinesisAPI_UpdateShardCount_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/aws/kinesis/v1/kinesis.pb.validate.go b/backend/api/aws/kinesis/v1/kinesis.pb.validate.go new file mode 100644 index 0000000000..e0b0847fc9 --- /dev/null +++ b/backend/api/aws/kinesis/v1/kinesis.pb.validate.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: aws/kinesis/v1/kinesis.proto + +package kinesisv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _kinesis_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on GetStreamRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *GetStreamRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for StreamName + + // no validation rules for Region + + return nil +} + +// GetStreamRequestValidationError is the validation error returned by +// GetStreamRequest.Validate if the designated constraints aren't met. +type GetStreamRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetStreamRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetStreamRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetStreamRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetStreamRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetStreamRequestValidationError) ErrorName() string { return "GetStreamRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetStreamRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetStreamRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetStreamRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetStreamRequestValidationError{} + +// Validate checks the field values on GetStreamResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *GetStreamResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetStream()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetStreamResponseValidationError{ + field: "Stream", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// GetStreamResponseValidationError is the validation error returned by +// GetStreamResponse.Validate if the designated constraints aren't met. +type GetStreamResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetStreamResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetStreamResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetStreamResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetStreamResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetStreamResponseValidationError) ErrorName() string { + return "GetStreamResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetStreamResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetStreamResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetStreamResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetStreamResponseValidationError{} + +// Validate checks the field values on UpdateShardCountRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateShardCountRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for StreamName + + // no validation rules for Region + + // no validation rules for TargetShardCount + + return nil +} + +// UpdateShardCountRequestValidationError is the validation error returned by +// UpdateShardCountRequest.Validate if the designated constraints aren't met. +type UpdateShardCountRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateShardCountRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateShardCountRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateShardCountRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateShardCountRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateShardCountRequestValidationError) ErrorName() string { + return "UpdateShardCountRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateShardCountRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateShardCountRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateShardCountRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateShardCountRequestValidationError{} + +// Validate checks the field values on UpdateShardCountResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateShardCountResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// UpdateShardCountResponseValidationError is the validation error returned by +// UpdateShardCountResponse.Validate if the designated constraints aren't met. +type UpdateShardCountResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateShardCountResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateShardCountResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateShardCountResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateShardCountResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateShardCountResponseValidationError) ErrorName() string { + return "UpdateShardCountResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateShardCountResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateShardCountResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateShardCountResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateShardCountResponseValidationError{} + +// Validate checks the field values on Stream with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Stream) Validate() error { + if m == nil { + return nil + } + + // no validation rules for StreamName + + // no validation rules for Region + + // no validation rules for CurrentShardCount + + return nil +} + +// StreamValidationError is the validation error returned by Stream.Validate if +// the designated constraints aren't met. +type StreamValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StreamValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StreamValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StreamValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StreamValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StreamValidationError) ErrorName() string { return "StreamValidationError" } + +// Error satisfies the builtin error interface +func (e StreamValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStream.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StreamValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StreamValidationError{} diff --git a/backend/api/chaos/experimentation/v1/experiment.pb.go b/backend/api/chaos/experimentation/v1/experiment.pb.go new file mode 100644 index 0000000000..3e876624ee --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experiment.pb.go @@ -0,0 +1,274 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/experimentation/v1/experiment.proto + +package experimentationv1 + +import ( + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Experiment_Status int32 + +const ( + // Unspecified Status. + Experiment_STATUS_UNSPECIFIED Experiment_Status = 0 + // An experiment is specified to be run at a future date. + Experiment_STATUS_SCHEDULED Experiment_Status = 1 + // An experiment is currently running. + Experiment_STATUS_RUNNING Experiment_Status = 2 + // An experiment has completed. + Experiment_STATUS_COMPLETED Experiment_Status = 3 + // An experiment has been canceled before it started. + Experiment_STATUS_CANCELED Experiment_Status = 4 + // An experiment was running and was stopped before its originally scheduled end time. + Experiment_STATUS_STOPPED Experiment_Status = 5 +) + +// Enum value maps for Experiment_Status. +var ( + Experiment_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_SCHEDULED", + 2: "STATUS_RUNNING", + 3: "STATUS_COMPLETED", + 4: "STATUS_CANCELED", + 5: "STATUS_STOPPED", + } + Experiment_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_SCHEDULED": 1, + "STATUS_RUNNING": 2, + "STATUS_COMPLETED": 3, + "STATUS_CANCELED": 4, + "STATUS_STOPPED": 5, + } +) + +func (x Experiment_Status) Enum() *Experiment_Status { + p := new(Experiment_Status) + *p = x + return p +} + +func (x Experiment_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Experiment_Status) Descriptor() protoreflect.EnumDescriptor { + return file_chaos_experimentation_v1_experiment_proto_enumTypes[0].Descriptor() +} + +func (Experiment_Status) Type() protoreflect.EnumType { + return &file_chaos_experimentation_v1_experiment_proto_enumTypes[0] +} + +func (x Experiment_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Experiment_Status.Descriptor instead. +func (Experiment_Status) EnumDescriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experiment_proto_rawDescGZIP(), []int{0, 0} +} + +type Experiment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The experiment configuration specific to the type of experiment + Config *any.Any `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + // The time when the experiment should start. If unspecified, defaults to 'now' + StartTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // The time when the experiment should end, If unspecified, the experiment runs indefinitely unless it is manually + // stopped by a user. + EndTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` +} + +func (x *Experiment) Reset() { + *x = Experiment{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experiment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Experiment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Experiment) ProtoMessage() {} + +func (x *Experiment) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experiment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Experiment.ProtoReflect.Descriptor instead. +func (*Experiment) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experiment_proto_rawDescGZIP(), []int{0} +} + +func (x *Experiment) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Experiment) GetConfig() *any.Any { + if x != nil { + return x.Config + } + return nil +} + +func (x *Experiment) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *Experiment) GetEndTime() *timestamp.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +var File_chaos_experimentation_v1_experiment_proto protoreflect.FileDescriptor + +var file_chaos_experimentation_v1_experiment_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, + 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x02, 0x0a, 0x0a, 0x45, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, + 0x4e, 0x47, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, + 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, + 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, + 0x44, 0x10, 0x05, 0x42, 0x13, 0x5a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chaos_experimentation_v1_experiment_proto_rawDescOnce sync.Once + file_chaos_experimentation_v1_experiment_proto_rawDescData = file_chaos_experimentation_v1_experiment_proto_rawDesc +) + +func file_chaos_experimentation_v1_experiment_proto_rawDescGZIP() []byte { + file_chaos_experimentation_v1_experiment_proto_rawDescOnce.Do(func() { + file_chaos_experimentation_v1_experiment_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_experimentation_v1_experiment_proto_rawDescData) + }) + return file_chaos_experimentation_v1_experiment_proto_rawDescData +} + +var file_chaos_experimentation_v1_experiment_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_chaos_experimentation_v1_experiment_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_chaos_experimentation_v1_experiment_proto_goTypes = []interface{}{ + (Experiment_Status)(0), // 0: clutch.chaos.experimentation.v1.Experiment.Status + (*Experiment)(nil), // 1: clutch.chaos.experimentation.v1.Experiment + (*any.Any)(nil), // 2: google.protobuf.Any + (*timestamp.Timestamp)(nil), // 3: google.protobuf.Timestamp +} +var file_chaos_experimentation_v1_experiment_proto_depIdxs = []int32{ + 2, // 0: clutch.chaos.experimentation.v1.Experiment.config:type_name -> google.protobuf.Any + 3, // 1: clutch.chaos.experimentation.v1.Experiment.start_time:type_name -> google.protobuf.Timestamp + 3, // 2: clutch.chaos.experimentation.v1.Experiment.end_time:type_name -> google.protobuf.Timestamp + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_chaos_experimentation_v1_experiment_proto_init() } +func file_chaos_experimentation_v1_experiment_proto_init() { + if File_chaos_experimentation_v1_experiment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_chaos_experimentation_v1_experiment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Experiment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_experimentation_v1_experiment_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chaos_experimentation_v1_experiment_proto_goTypes, + DependencyIndexes: file_chaos_experimentation_v1_experiment_proto_depIdxs, + EnumInfos: file_chaos_experimentation_v1_experiment_proto_enumTypes, + MessageInfos: file_chaos_experimentation_v1_experiment_proto_msgTypes, + }.Build() + File_chaos_experimentation_v1_experiment_proto = out.File + file_chaos_experimentation_v1_experiment_proto_rawDesc = nil + file_chaos_experimentation_v1_experiment_proto_goTypes = nil + file_chaos_experimentation_v1_experiment_proto_depIdxs = nil +} diff --git a/backend/api/chaos/experimentation/v1/experiment.pb.validate.go b/backend/api/chaos/experimentation/v1/experiment.pb.validate.go new file mode 100644 index 0000000000..6f587e9401 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experiment.pb.validate.go @@ -0,0 +1,133 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/experimentation/v1/experiment.proto + +package experimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _experiment_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Experiment with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Experiment) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExperimentValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExperimentValidationError{ + field: "StartTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetEndTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExperimentValidationError{ + field: "EndTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ExperimentValidationError is the validation error returned by +// Experiment.Validate if the designated constraints aren't met. +type ExperimentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExperimentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExperimentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExperimentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExperimentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExperimentValidationError) ErrorName() string { return "ExperimentValidationError" } + +// Error satisfies the builtin error interface +func (e ExperimentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExperiment.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExperimentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExperimentValidationError{} diff --git a/backend/api/chaos/experimentation/v1/experiment_run_details.pb.go b/backend/api/chaos/experimentation/v1/experiment_run_details.pb.go new file mode 100644 index 0000000000..611de4721c --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experiment_run_details.pb.go @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/experimentation/v1/experiment_run_details.proto + +package experimentationv1 + +import ( + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// ExperimentRunDetails frontend-renderable details of an experiment run and experiment config associated with it. +type ExperimentRunDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of an experiment run. + RunId uint64 `protobuf:"fixed64,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` + // The status of an experiment run. + Status Experiment_Status `protobuf:"varint,2,opt,name=status,proto3,enum=clutch.chaos.experimentation.v1.Experiment_Status" json:"status,omitempty"` + // The list of properties associated with the receiver that's created as a combination + // of properties for a given experiment run and an experiment config for the run. + Properties *PropertiesList `protobuf:"bytes,3,opt,name=properties,proto3" json:"properties,omitempty"` + // The raw experiment configuration associated with an experiment run. + Config *any.Any `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ExperimentRunDetails) Reset() { + *x = ExperimentRunDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experiment_run_details_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExperimentRunDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExperimentRunDetails) ProtoMessage() {} + +func (x *ExperimentRunDetails) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experiment_run_details_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExperimentRunDetails.ProtoReflect.Descriptor instead. +func (*ExperimentRunDetails) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experiment_run_details_proto_rawDescGZIP(), []int{0} +} + +func (x *ExperimentRunDetails) GetRunId() uint64 { + if x != nil { + return x.RunId + } + return 0 +} + +func (x *ExperimentRunDetails) GetStatus() Experiment_Status { + if x != nil { + return x.Status + } + return Experiment_STATUS_UNSPECIFIED +} + +func (x *ExperimentRunDetails) GetProperties() *PropertiesList { + if x != nil { + return x.Properties + } + return nil +} + +func (x *ExperimentRunDetails) GetConfig() *any.Any { + if x != nil { + return x.Config + } + return nil +} + +var File_chaos_experimentation_v1_experiment_run_details_proto protoreflect.FileDescriptor + +var file_chaos_experimentation_v1_experiment_run_details_proto_rawDesc = []byte{ + 0x0a, 0x35, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, + 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, + 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, + 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x14, 0x45, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x06, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x42, 0x13, 0x5a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_chaos_experimentation_v1_experiment_run_details_proto_rawDescOnce sync.Once + file_chaos_experimentation_v1_experiment_run_details_proto_rawDescData = file_chaos_experimentation_v1_experiment_run_details_proto_rawDesc +) + +func file_chaos_experimentation_v1_experiment_run_details_proto_rawDescGZIP() []byte { + file_chaos_experimentation_v1_experiment_run_details_proto_rawDescOnce.Do(func() { + file_chaos_experimentation_v1_experiment_run_details_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_experimentation_v1_experiment_run_details_proto_rawDescData) + }) + return file_chaos_experimentation_v1_experiment_run_details_proto_rawDescData +} + +var file_chaos_experimentation_v1_experiment_run_details_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_chaos_experimentation_v1_experiment_run_details_proto_goTypes = []interface{}{ + (*ExperimentRunDetails)(nil), // 0: clutch.chaos.experimentation.v1.ExperimentRunDetails + (Experiment_Status)(0), // 1: clutch.chaos.experimentation.v1.Experiment.Status + (*PropertiesList)(nil), // 2: clutch.chaos.experimentation.v1.PropertiesList + (*any.Any)(nil), // 3: google.protobuf.Any +} +var file_chaos_experimentation_v1_experiment_run_details_proto_depIdxs = []int32{ + 1, // 0: clutch.chaos.experimentation.v1.ExperimentRunDetails.status:type_name -> clutch.chaos.experimentation.v1.Experiment.Status + 2, // 1: clutch.chaos.experimentation.v1.ExperimentRunDetails.properties:type_name -> clutch.chaos.experimentation.v1.PropertiesList + 3, // 2: clutch.chaos.experimentation.v1.ExperimentRunDetails.config:type_name -> google.protobuf.Any + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_chaos_experimentation_v1_experiment_run_details_proto_init() } +func file_chaos_experimentation_v1_experiment_run_details_proto_init() { + if File_chaos_experimentation_v1_experiment_run_details_proto != nil { + return + } + file_chaos_experimentation_v1_properties_proto_init() + file_chaos_experimentation_v1_experiment_proto_init() + if !protoimpl.UnsafeEnabled { + file_chaos_experimentation_v1_experiment_run_details_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExperimentRunDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_experimentation_v1_experiment_run_details_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chaos_experimentation_v1_experiment_run_details_proto_goTypes, + DependencyIndexes: file_chaos_experimentation_v1_experiment_run_details_proto_depIdxs, + MessageInfos: file_chaos_experimentation_v1_experiment_run_details_proto_msgTypes, + }.Build() + File_chaos_experimentation_v1_experiment_run_details_proto = out.File + file_chaos_experimentation_v1_experiment_run_details_proto_rawDesc = nil + file_chaos_experimentation_v1_experiment_run_details_proto_goTypes = nil + file_chaos_experimentation_v1_experiment_run_details_proto_depIdxs = nil +} diff --git a/backend/api/chaos/experimentation/v1/experiment_run_details.pb.validate.go b/backend/api/chaos/experimentation/v1/experiment_run_details.pb.validate.go new file mode 100644 index 0000000000..5cde23f645 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experiment_run_details.pb.validate.go @@ -0,0 +1,128 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/experimentation/v1/experiment_run_details.proto + +package experimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _experiment_run_details_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on ExperimentRunDetails with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ExperimentRunDetails) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RunId + + // no validation rules for Status + + if v, ok := interface{}(m.GetProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExperimentRunDetailsValidationError{ + field: "Properties", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExperimentRunDetailsValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ExperimentRunDetailsValidationError is the validation error returned by +// ExperimentRunDetails.Validate if the designated constraints aren't met. +type ExperimentRunDetailsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExperimentRunDetailsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExperimentRunDetailsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExperimentRunDetailsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExperimentRunDetailsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExperimentRunDetailsValidationError) ErrorName() string { + return "ExperimentRunDetailsValidationError" +} + +// Error satisfies the builtin error interface +func (e ExperimentRunDetailsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExperimentRunDetails.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExperimentRunDetailsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExperimentRunDetailsValidationError{} diff --git a/backend/api/chaos/experimentation/v1/experimentation.pb.go b/backend/api/chaos/experimentation/v1/experimentation.pb.go new file mode 100644 index 0000000000..965273a9c4 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experimentation.pb.go @@ -0,0 +1,1145 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/experimentation/v1/experimentation.proto + +package experimentationv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type GetExperimentsRequest_Status int32 + +const ( + GetExperimentsRequest_STATUS_UNSPECIFIED GetExperimentsRequest_Status = 0 + GetExperimentsRequest_STATUS_RUNNING GetExperimentsRequest_Status = 1 +) + +// Enum value maps for GetExperimentsRequest_Status. +var ( + GetExperimentsRequest_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_RUNNING", + } + GetExperimentsRequest_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_RUNNING": 1, + } +) + +func (x GetExperimentsRequest_Status) Enum() *GetExperimentsRequest_Status { + p := new(GetExperimentsRequest_Status) + *p = x + return p +} + +func (x GetExperimentsRequest_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GetExperimentsRequest_Status) Descriptor() protoreflect.EnumDescriptor { + return file_chaos_experimentation_v1_experimentation_proto_enumTypes[0].Descriptor() +} + +func (GetExperimentsRequest_Status) Type() protoreflect.EnumType { + return &file_chaos_experimentation_v1_experimentation_proto_enumTypes[0] +} + +func (x GetExperimentsRequest_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GetExperimentsRequest_Status.Descriptor instead. +func (GetExperimentsRequest_Status) EnumDescriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{2, 0} +} + +type CreateExperimentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The experiment configuration specific to the type of experiment + Config *any.Any `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + // The time when the experiment should start. If unspecified, defaults to 'now' + StartTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // The time when the experiment should end, If unspecified, the experiment runs indefinitely. + EndTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` +} + +func (x *CreateExperimentRequest) Reset() { + *x = CreateExperimentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateExperimentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateExperimentRequest) ProtoMessage() {} + +func (x *CreateExperimentRequest) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateExperimentRequest.ProtoReflect.Descriptor instead. +func (*CreateExperimentRequest) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateExperimentRequest) GetConfig() *any.Any { + if x != nil { + return x.Config + } + return nil +} + +func (x *CreateExperimentRequest) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *CreateExperimentRequest) GetEndTime() *timestamp.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +type CreateExperimentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Experiment *Experiment `protobuf:"bytes,1,opt,name=experiment,proto3" json:"experiment,omitempty"` +} + +func (x *CreateExperimentResponse) Reset() { + *x = CreateExperimentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateExperimentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateExperimentResponse) ProtoMessage() {} + +func (x *CreateExperimentResponse) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateExperimentResponse.ProtoReflect.Descriptor instead. +func (*CreateExperimentResponse) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateExperimentResponse) GetExperiment() *Experiment { + if x != nil { + return x.Experiment + } + return nil +} + +type GetExperimentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigType string `protobuf:"bytes,1,opt,name=config_type,json=configType,proto3" json:"config_type,omitempty"` + Status GetExperimentsRequest_Status `protobuf:"varint,2,opt,name=status,proto3,enum=clutch.chaos.experimentation.v1.GetExperimentsRequest_Status" json:"status,omitempty"` +} + +func (x *GetExperimentsRequest) Reset() { + *x = GetExperimentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExperimentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExperimentsRequest) ProtoMessage() {} + +func (x *GetExperimentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExperimentsRequest.ProtoReflect.Descriptor instead. +func (*GetExperimentsRequest) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{2} +} + +func (x *GetExperimentsRequest) GetConfigType() string { + if x != nil { + return x.ConfigType + } + return "" +} + +func (x *GetExperimentsRequest) GetStatus() GetExperimentsRequest_Status { + if x != nil { + return x.Status + } + return GetExperimentsRequest_STATUS_UNSPECIFIED +} + +type GetExperimentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Experiments []*Experiment `protobuf:"bytes,1,rep,name=experiments,proto3" json:"experiments,omitempty"` +} + +func (x *GetExperimentsResponse) Reset() { + *x = GetExperimentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExperimentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExperimentsResponse) ProtoMessage() {} + +func (x *GetExperimentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExperimentsResponse.ProtoReflect.Descriptor instead. +func (*GetExperimentsResponse) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{3} +} + +func (x *GetExperimentsResponse) GetExperiments() []*Experiment { + if x != nil { + return x.Experiments + } + return nil +} + +type CancelExperimentRunRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *CancelExperimentRunRequest) Reset() { + *x = CancelExperimentRunRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelExperimentRunRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelExperimentRunRequest) ProtoMessage() {} + +func (x *CancelExperimentRunRequest) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelExperimentRunRequest.ProtoReflect.Descriptor instead. +func (*CancelExperimentRunRequest) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{4} +} + +func (x *CancelExperimentRunRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type CancelExperimentRunResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelExperimentRunResponse) Reset() { + *x = CancelExperimentRunResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelExperimentRunResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelExperimentRunResponse) ProtoMessage() {} + +func (x *CancelExperimentRunResponse) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelExperimentRunResponse.ProtoReflect.Descriptor instead. +func (*CancelExperimentRunResponse) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{5} +} + +type GetListViewRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListViewRequest) Reset() { + *x = GetListViewRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListViewRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListViewRequest) ProtoMessage() {} + +func (x *GetListViewRequest) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListViewRequest.ProtoReflect.Descriptor instead. +func (*GetListViewRequest) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{6} +} + +type GetListViewResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*ListViewItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *GetListViewResponse) Reset() { + *x = GetListViewResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListViewResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListViewResponse) ProtoMessage() {} + +func (x *GetListViewResponse) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListViewResponse.ProtoReflect.Descriptor instead. +func (*GetListViewResponse) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{7} +} + +func (x *GetListViewResponse) GetItems() []*ListViewItem { + if x != nil { + return x.Items + } + return nil +} + +type GetExperimentRunDetailsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetExperimentRunDetailsRequest) Reset() { + *x = GetExperimentRunDetailsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExperimentRunDetailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExperimentRunDetailsRequest) ProtoMessage() {} + +func (x *GetExperimentRunDetailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExperimentRunDetailsRequest.ProtoReflect.Descriptor instead. +func (*GetExperimentRunDetailsRequest) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{8} +} + +func (x *GetExperimentRunDetailsRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetExperimentRunDetailsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RunDetails *ExperimentRunDetails `protobuf:"bytes,1,opt,name=run_details,json=runDetails,proto3" json:"run_details,omitempty"` +} + +func (x *GetExperimentRunDetailsResponse) Reset() { + *x = GetExperimentRunDetailsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExperimentRunDetailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExperimentRunDetailsResponse) ProtoMessage() {} + +func (x *GetExperimentRunDetailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_experimentation_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExperimentRunDetailsResponse.ProtoReflect.Descriptor instead. +func (*GetExperimentRunDetailsResponse) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP(), []int{9} +} + +func (x *GetExperimentRunDetailsResponse) GetRunDetails() *ExperimentRunDetails { + if x != nil { + return x.RunDetails + } + return nil +} + +var File_chaos_experimentation_v1_experimentation_proto protoreflect.FileDescriptor + +var file_chaos_experimentation_v1_experimentation_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, + 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x1f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2d, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x76, 0x69, 0x65, 0x77, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x35, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x22, 0x67, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, + 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, + 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xc5, 0x01, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x55, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x34, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x22, 0x67, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, + 0x0b, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, + 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0b, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2c, 0x0a, 0x1a, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x5a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, + 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x30, 0x0a, 0x1e, 0x47, + 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x79, 0x0a, + 0x1f, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, + 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x56, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, + 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0a, 0x72, 0x75, + 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x32, 0xff, 0x07, 0x0a, 0x0e, 0x45, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x41, 0x50, 0x49, 0x12, 0xc4, 0x01, 0x0a, 0x10, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x38, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, + 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, + 0x08, 0x01, 0x12, 0xd0, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x45, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x12, 0x3b, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x45, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x3a, 0x01, 0x2a, 0xaa, + 0xe1, 0x1c, 0x02, 0x08, 0x04, 0x12, 0xbc, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x37, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, + 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x65, 0x74, + 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, + 0x1c, 0x02, 0x08, 0x02, 0x12, 0xb0, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x69, 0x65, 0x77, 0x12, 0x33, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, + 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, + 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, + 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x3a, 0x01, + 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0xe0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x12, 0x3f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, + 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, + 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x22, 0x31, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x65, 0x74, 0x45, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x75, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x42, 0x13, 0x5a, 0x11, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chaos_experimentation_v1_experimentation_proto_rawDescOnce sync.Once + file_chaos_experimentation_v1_experimentation_proto_rawDescData = file_chaos_experimentation_v1_experimentation_proto_rawDesc +) + +func file_chaos_experimentation_v1_experimentation_proto_rawDescGZIP() []byte { + file_chaos_experimentation_v1_experimentation_proto_rawDescOnce.Do(func() { + file_chaos_experimentation_v1_experimentation_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_experimentation_v1_experimentation_proto_rawDescData) + }) + return file_chaos_experimentation_v1_experimentation_proto_rawDescData +} + +var file_chaos_experimentation_v1_experimentation_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_chaos_experimentation_v1_experimentation_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_chaos_experimentation_v1_experimentation_proto_goTypes = []interface{}{ + (GetExperimentsRequest_Status)(0), // 0: clutch.chaos.experimentation.v1.GetExperimentsRequest.Status + (*CreateExperimentRequest)(nil), // 1: clutch.chaos.experimentation.v1.CreateExperimentRequest + (*CreateExperimentResponse)(nil), // 2: clutch.chaos.experimentation.v1.CreateExperimentResponse + (*GetExperimentsRequest)(nil), // 3: clutch.chaos.experimentation.v1.GetExperimentsRequest + (*GetExperimentsResponse)(nil), // 4: clutch.chaos.experimentation.v1.GetExperimentsResponse + (*CancelExperimentRunRequest)(nil), // 5: clutch.chaos.experimentation.v1.CancelExperimentRunRequest + (*CancelExperimentRunResponse)(nil), // 6: clutch.chaos.experimentation.v1.CancelExperimentRunResponse + (*GetListViewRequest)(nil), // 7: clutch.chaos.experimentation.v1.GetListViewRequest + (*GetListViewResponse)(nil), // 8: clutch.chaos.experimentation.v1.GetListViewResponse + (*GetExperimentRunDetailsRequest)(nil), // 9: clutch.chaos.experimentation.v1.GetExperimentRunDetailsRequest + (*GetExperimentRunDetailsResponse)(nil), // 10: clutch.chaos.experimentation.v1.GetExperimentRunDetailsResponse + (*any.Any)(nil), // 11: google.protobuf.Any + (*timestamp.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*Experiment)(nil), // 13: clutch.chaos.experimentation.v1.Experiment + (*ListViewItem)(nil), // 14: clutch.chaos.experimentation.v1.ListViewItem + (*ExperimentRunDetails)(nil), // 15: clutch.chaos.experimentation.v1.ExperimentRunDetails +} +var file_chaos_experimentation_v1_experimentation_proto_depIdxs = []int32{ + 11, // 0: clutch.chaos.experimentation.v1.CreateExperimentRequest.config:type_name -> google.protobuf.Any + 12, // 1: clutch.chaos.experimentation.v1.CreateExperimentRequest.start_time:type_name -> google.protobuf.Timestamp + 12, // 2: clutch.chaos.experimentation.v1.CreateExperimentRequest.end_time:type_name -> google.protobuf.Timestamp + 13, // 3: clutch.chaos.experimentation.v1.CreateExperimentResponse.experiment:type_name -> clutch.chaos.experimentation.v1.Experiment + 0, // 4: clutch.chaos.experimentation.v1.GetExperimentsRequest.status:type_name -> clutch.chaos.experimentation.v1.GetExperimentsRequest.Status + 13, // 5: clutch.chaos.experimentation.v1.GetExperimentsResponse.experiments:type_name -> clutch.chaos.experimentation.v1.Experiment + 14, // 6: clutch.chaos.experimentation.v1.GetListViewResponse.items:type_name -> clutch.chaos.experimentation.v1.ListViewItem + 15, // 7: clutch.chaos.experimentation.v1.GetExperimentRunDetailsResponse.run_details:type_name -> clutch.chaos.experimentation.v1.ExperimentRunDetails + 1, // 8: clutch.chaos.experimentation.v1.ExperimentsAPI.CreateExperiment:input_type -> clutch.chaos.experimentation.v1.CreateExperimentRequest + 5, // 9: clutch.chaos.experimentation.v1.ExperimentsAPI.CancelExperimentRun:input_type -> clutch.chaos.experimentation.v1.CancelExperimentRunRequest + 3, // 10: clutch.chaos.experimentation.v1.ExperimentsAPI.GetExperiments:input_type -> clutch.chaos.experimentation.v1.GetExperimentsRequest + 7, // 11: clutch.chaos.experimentation.v1.ExperimentsAPI.GetListView:input_type -> clutch.chaos.experimentation.v1.GetListViewRequest + 9, // 12: clutch.chaos.experimentation.v1.ExperimentsAPI.GetExperimentRunDetails:input_type -> clutch.chaos.experimentation.v1.GetExperimentRunDetailsRequest + 2, // 13: clutch.chaos.experimentation.v1.ExperimentsAPI.CreateExperiment:output_type -> clutch.chaos.experimentation.v1.CreateExperimentResponse + 6, // 14: clutch.chaos.experimentation.v1.ExperimentsAPI.CancelExperimentRun:output_type -> clutch.chaos.experimentation.v1.CancelExperimentRunResponse + 4, // 15: clutch.chaos.experimentation.v1.ExperimentsAPI.GetExperiments:output_type -> clutch.chaos.experimentation.v1.GetExperimentsResponse + 8, // 16: clutch.chaos.experimentation.v1.ExperimentsAPI.GetListView:output_type -> clutch.chaos.experimentation.v1.GetListViewResponse + 10, // 17: clutch.chaos.experimentation.v1.ExperimentsAPI.GetExperimentRunDetails:output_type -> clutch.chaos.experimentation.v1.GetExperimentRunDetailsResponse + 13, // [13:18] is the sub-list for method output_type + 8, // [8:13] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_chaos_experimentation_v1_experimentation_proto_init() } +func file_chaos_experimentation_v1_experimentation_proto_init() { + if File_chaos_experimentation_v1_experimentation_proto != nil { + return + } + file_chaos_experimentation_v1_experiment_proto_init() + file_chaos_experimentation_v1_list_view_item_proto_init() + file_chaos_experimentation_v1_experiment_run_details_proto_init() + if !protoimpl.UnsafeEnabled { + file_chaos_experimentation_v1_experimentation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateExperimentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateExperimentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExperimentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExperimentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelExperimentRunRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelExperimentRunResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListViewRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListViewResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExperimentRunDetailsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_experimentation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExperimentRunDetailsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_experimentation_v1_experimentation_proto_rawDesc, + NumEnums: 1, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_chaos_experimentation_v1_experimentation_proto_goTypes, + DependencyIndexes: file_chaos_experimentation_v1_experimentation_proto_depIdxs, + EnumInfos: file_chaos_experimentation_v1_experimentation_proto_enumTypes, + MessageInfos: file_chaos_experimentation_v1_experimentation_proto_msgTypes, + }.Build() + File_chaos_experimentation_v1_experimentation_proto = out.File + file_chaos_experimentation_v1_experimentation_proto_rawDesc = nil + file_chaos_experimentation_v1_experimentation_proto_goTypes = nil + file_chaos_experimentation_v1_experimentation_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ExperimentsAPIClient is the client API for ExperimentsAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ExperimentsAPIClient interface { + CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*CreateExperimentResponse, error) + CancelExperimentRun(ctx context.Context, in *CancelExperimentRunRequest, opts ...grpc.CallOption) (*CancelExperimentRunResponse, error) + GetExperiments(ctx context.Context, in *GetExperimentsRequest, opts ...grpc.CallOption) (*GetExperimentsResponse, error) + GetListView(ctx context.Context, in *GetListViewRequest, opts ...grpc.CallOption) (*GetListViewResponse, error) + GetExperimentRunDetails(ctx context.Context, in *GetExperimentRunDetailsRequest, opts ...grpc.CallOption) (*GetExperimentRunDetailsResponse, error) +} + +type experimentsAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewExperimentsAPIClient(cc grpc.ClientConnInterface) ExperimentsAPIClient { + return &experimentsAPIClient{cc} +} + +func (c *experimentsAPIClient) CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*CreateExperimentResponse, error) { + out := new(CreateExperimentResponse) + err := c.cc.Invoke(ctx, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CreateExperiment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *experimentsAPIClient) CancelExperimentRun(ctx context.Context, in *CancelExperimentRunRequest, opts ...grpc.CallOption) (*CancelExperimentRunResponse, error) { + out := new(CancelExperimentRunResponse) + err := c.cc.Invoke(ctx, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CancelExperimentRun", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *experimentsAPIClient) GetExperiments(ctx context.Context, in *GetExperimentsRequest, opts ...grpc.CallOption) (*GetExperimentsResponse, error) { + out := new(GetExperimentsResponse) + err := c.cc.Invoke(ctx, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperiments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *experimentsAPIClient) GetListView(ctx context.Context, in *GetListViewRequest, opts ...grpc.CallOption) (*GetListViewResponse, error) { + out := new(GetListViewResponse) + err := c.cc.Invoke(ctx, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetListView", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *experimentsAPIClient) GetExperimentRunDetails(ctx context.Context, in *GetExperimentRunDetailsRequest, opts ...grpc.CallOption) (*GetExperimentRunDetailsResponse, error) { + out := new(GetExperimentRunDetailsResponse) + err := c.cc.Invoke(ctx, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperimentRunDetails", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ExperimentsAPIServer is the server API for ExperimentsAPI service. +type ExperimentsAPIServer interface { + CreateExperiment(context.Context, *CreateExperimentRequest) (*CreateExperimentResponse, error) + CancelExperimentRun(context.Context, *CancelExperimentRunRequest) (*CancelExperimentRunResponse, error) + GetExperiments(context.Context, *GetExperimentsRequest) (*GetExperimentsResponse, error) + GetListView(context.Context, *GetListViewRequest) (*GetListViewResponse, error) + GetExperimentRunDetails(context.Context, *GetExperimentRunDetailsRequest) (*GetExperimentRunDetailsResponse, error) +} + +// UnimplementedExperimentsAPIServer can be embedded to have forward compatible implementations. +type UnimplementedExperimentsAPIServer struct { +} + +func (*UnimplementedExperimentsAPIServer) CreateExperiment(context.Context, *CreateExperimentRequest) (*CreateExperimentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateExperiment not implemented") +} +func (*UnimplementedExperimentsAPIServer) CancelExperimentRun(context.Context, *CancelExperimentRunRequest) (*CancelExperimentRunResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelExperimentRun not implemented") +} +func (*UnimplementedExperimentsAPIServer) GetExperiments(context.Context, *GetExperimentsRequest) (*GetExperimentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExperiments not implemented") +} +func (*UnimplementedExperimentsAPIServer) GetListView(context.Context, *GetListViewRequest) (*GetListViewResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListView not implemented") +} +func (*UnimplementedExperimentsAPIServer) GetExperimentRunDetails(context.Context, *GetExperimentRunDetailsRequest) (*GetExperimentRunDetailsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExperimentRunDetails not implemented") +} + +func RegisterExperimentsAPIServer(s *grpc.Server, srv ExperimentsAPIServer) { + s.RegisterService(&_ExperimentsAPI_serviceDesc, srv) +} + +func _ExperimentsAPI_CreateExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateExperimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentsAPIServer).CreateExperiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.chaos.experimentation.v1.ExperimentsAPI/CreateExperiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentsAPIServer).CreateExperiment(ctx, req.(*CreateExperimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExperimentsAPI_CancelExperimentRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelExperimentRunRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentsAPIServer).CancelExperimentRun(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.chaos.experimentation.v1.ExperimentsAPI/CancelExperimentRun", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentsAPIServer).CancelExperimentRun(ctx, req.(*CancelExperimentRunRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExperimentsAPI_GetExperiments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExperimentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentsAPIServer).GetExperiments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperiments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentsAPIServer).GetExperiments(ctx, req.(*GetExperimentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExperimentsAPI_GetListView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetListViewRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentsAPIServer).GetListView(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetListView", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentsAPIServer).GetListView(ctx, req.(*GetListViewRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExperimentsAPI_GetExperimentRunDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExperimentRunDetailsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentsAPIServer).GetExperimentRunDetails(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperimentRunDetails", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentsAPIServer).GetExperimentRunDetails(ctx, req.(*GetExperimentRunDetailsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ExperimentsAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.chaos.experimentation.v1.ExperimentsAPI", + HandlerType: (*ExperimentsAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateExperiment", + Handler: _ExperimentsAPI_CreateExperiment_Handler, + }, + { + MethodName: "CancelExperimentRun", + Handler: _ExperimentsAPI_CancelExperimentRun_Handler, + }, + { + MethodName: "GetExperiments", + Handler: _ExperimentsAPI_GetExperiments_Handler, + }, + { + MethodName: "GetListView", + Handler: _ExperimentsAPI_GetListView_Handler, + }, + { + MethodName: "GetExperimentRunDetails", + Handler: _ExperimentsAPI_GetExperimentRunDetails_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "chaos/experimentation/v1/experimentation.proto", +} diff --git a/backend/api/chaos/experimentation/v1/experimentation.pb.gw.go b/backend/api/chaos/experimentation/v1/experimentation.pb.gw.go new file mode 100644 index 0000000000..00166d8361 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experimentation.pb.gw.go @@ -0,0 +1,491 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: chaos/experimentation/v1/experimentation.proto + +/* +Package experimentationv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package experimentationv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ExperimentsAPI_CreateExperiment_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateExperimentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateExperiment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentsAPI_CreateExperiment_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateExperimentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateExperiment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ExperimentsAPI_CancelExperimentRun_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CancelExperimentRunRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CancelExperimentRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentsAPI_CancelExperimentRun_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CancelExperimentRunRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CancelExperimentRun(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ExperimentsAPI_GetExperiments_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetExperimentsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetExperiments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentsAPI_GetExperiments_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetExperimentsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetExperiments(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ExperimentsAPI_GetListView_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetListViewRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentsAPI_GetListView_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetListViewRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListView(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ExperimentsAPI_GetExperimentRunDetails_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetExperimentRunDetailsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetExperimentRunDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentsAPI_GetExperimentRunDetails_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetExperimentRunDetailsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetExperimentRunDetails(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterExperimentsAPIHandlerServer registers the http handlers for service ExperimentsAPI to "mux". +// UnaryRPC :call ExperimentsAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterExperimentsAPIHandlerFromEndpoint instead. +func RegisterExperimentsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExperimentsAPIServer) error { + + mux.Handle("POST", pattern_ExperimentsAPI_CreateExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CreateExperiment") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentsAPI_CreateExperiment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_CreateExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_CancelExperimentRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CancelExperimentRun") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentsAPI_CancelExperimentRun_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_CancelExperimentRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetExperiments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperiments") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentsAPI_GetExperiments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetExperiments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetListView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetListView") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentsAPI_GetListView_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetListView_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetExperimentRunDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperimentRunDetails") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentsAPI_GetExperimentRunDetails_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetExperimentRunDetails_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterExperimentsAPIHandlerFromEndpoint is same as RegisterExperimentsAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterExperimentsAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterExperimentsAPIHandler(ctx, mux, conn) +} + +// RegisterExperimentsAPIHandler registers the http handlers for service ExperimentsAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterExperimentsAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterExperimentsAPIHandlerClient(ctx, mux, NewExperimentsAPIClient(conn)) +} + +// RegisterExperimentsAPIHandlerClient registers the http handlers for service ExperimentsAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExperimentsAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExperimentsAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ExperimentsAPIClient" to call the correct interceptors. +func RegisterExperimentsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExperimentsAPIClient) error { + + mux.Handle("POST", pattern_ExperimentsAPI_CreateExperiment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CreateExperiment") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentsAPI_CreateExperiment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_CreateExperiment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_CancelExperimentRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/CancelExperimentRun") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentsAPI_CancelExperimentRun_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_CancelExperimentRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetExperiments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperiments") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentsAPI_GetExperiments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetExperiments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetListView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetListView") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentsAPI_GetListView_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetListView_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentsAPI_GetExperimentRunDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.chaos.experimentation.v1.ExperimentsAPI/GetExperimentRunDetails") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentsAPI_GetExperimentRunDetails_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentsAPI_GetExperimentRunDetails_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ExperimentsAPI_CreateExperiment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "chaos", "experimentation", "createExperiment"}, "")) + + pattern_ExperimentsAPI_CancelExperimentRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "chaos", "experimentation", "cancelExperimentRun"}, "")) + + pattern_ExperimentsAPI_GetExperiments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "chaos", "experimentation", "getExperiments"}, "")) + + pattern_ExperimentsAPI_GetListView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "chaos", "experimentation", "getListView"}, "")) + + pattern_ExperimentsAPI_GetExperimentRunDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "chaos", "experimentation", "getExperimentRunDetails"}, "")) +) + +var ( + forward_ExperimentsAPI_CreateExperiment_0 = runtime.ForwardResponseMessage + + forward_ExperimentsAPI_CancelExperimentRun_0 = runtime.ForwardResponseMessage + + forward_ExperimentsAPI_GetExperiments_0 = runtime.ForwardResponseMessage + + forward_ExperimentsAPI_GetListView_0 = runtime.ForwardResponseMessage + + forward_ExperimentsAPI_GetExperimentRunDetails_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/chaos/experimentation/v1/experimentation.pb.validate.go b/backend/api/chaos/experimentation/v1/experimentation.pb.validate.go new file mode 100644 index 0000000000..6163021e34 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/experimentation.pb.validate.go @@ -0,0 +1,798 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/experimentation/v1/experimentation.proto + +package experimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _experimentation_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on CreateExperimentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CreateExperimentRequest) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateExperimentRequestValidationError{ + field: "Config", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateExperimentRequestValidationError{ + field: "StartTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetEndTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateExperimentRequestValidationError{ + field: "EndTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// CreateExperimentRequestValidationError is the validation error returned by +// CreateExperimentRequest.Validate if the designated constraints aren't met. +type CreateExperimentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateExperimentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateExperimentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateExperimentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateExperimentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateExperimentRequestValidationError) ErrorName() string { + return "CreateExperimentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateExperimentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateExperimentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateExperimentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateExperimentRequestValidationError{} + +// Validate checks the field values on CreateExperimentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CreateExperimentResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetExperiment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateExperimentResponseValidationError{ + field: "Experiment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// CreateExperimentResponseValidationError is the validation error returned by +// CreateExperimentResponse.Validate if the designated constraints aren't met. +type CreateExperimentResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateExperimentResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateExperimentResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateExperimentResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateExperimentResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateExperimentResponseValidationError) ErrorName() string { + return "CreateExperimentResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateExperimentResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateExperimentResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateExperimentResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateExperimentResponseValidationError{} + +// Validate checks the field values on GetExperimentsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetExperimentsRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for ConfigType + + // no validation rules for Status + + return nil +} + +// GetExperimentsRequestValidationError is the validation error returned by +// GetExperimentsRequest.Validate if the designated constraints aren't met. +type GetExperimentsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetExperimentsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetExperimentsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetExperimentsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetExperimentsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetExperimentsRequestValidationError) ErrorName() string { + return "GetExperimentsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetExperimentsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetExperimentsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetExperimentsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetExperimentsRequestValidationError{} + +// Validate checks the field values on GetExperimentsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetExperimentsResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetExperiments() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetExperimentsResponseValidationError{ + field: fmt.Sprintf("Experiments[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// GetExperimentsResponseValidationError is the validation error returned by +// GetExperimentsResponse.Validate if the designated constraints aren't met. +type GetExperimentsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetExperimentsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetExperimentsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetExperimentsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetExperimentsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetExperimentsResponseValidationError) ErrorName() string { + return "GetExperimentsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetExperimentsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetExperimentsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetExperimentsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetExperimentsResponseValidationError{} + +// Validate checks the field values on CancelExperimentRunRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CancelExperimentRunRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + return nil +} + +// CancelExperimentRunRequestValidationError is the validation error returned +// by CancelExperimentRunRequest.Validate if the designated constraints aren't met. +type CancelExperimentRunRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CancelExperimentRunRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CancelExperimentRunRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CancelExperimentRunRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CancelExperimentRunRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CancelExperimentRunRequestValidationError) ErrorName() string { + return "CancelExperimentRunRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CancelExperimentRunRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCancelExperimentRunRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CancelExperimentRunRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CancelExperimentRunRequestValidationError{} + +// Validate checks the field values on CancelExperimentRunResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CancelExperimentRunResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// CancelExperimentRunResponseValidationError is the validation error returned +// by CancelExperimentRunResponse.Validate if the designated constraints +// aren't met. +type CancelExperimentRunResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CancelExperimentRunResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CancelExperimentRunResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CancelExperimentRunResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CancelExperimentRunResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CancelExperimentRunResponseValidationError) ErrorName() string { + return "CancelExperimentRunResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CancelExperimentRunResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCancelExperimentRunResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CancelExperimentRunResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CancelExperimentRunResponseValidationError{} + +// Validate checks the field values on GetListViewRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetListViewRequest) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// GetListViewRequestValidationError is the validation error returned by +// GetListViewRequest.Validate if the designated constraints aren't met. +type GetListViewRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetListViewRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetListViewRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetListViewRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetListViewRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetListViewRequestValidationError) ErrorName() string { + return "GetListViewRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetListViewRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetListViewRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetListViewRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetListViewRequestValidationError{} + +// Validate checks the field values on GetListViewResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetListViewResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetListViewResponseValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// GetListViewResponseValidationError is the validation error returned by +// GetListViewResponse.Validate if the designated constraints aren't met. +type GetListViewResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetListViewResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetListViewResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetListViewResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetListViewResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetListViewResponseValidationError) ErrorName() string { + return "GetListViewResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetListViewResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetListViewResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetListViewResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetListViewResponseValidationError{} + +// Validate checks the field values on GetExperimentRunDetailsRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetExperimentRunDetailsRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + return nil +} + +// GetExperimentRunDetailsRequestValidationError is the validation error +// returned by GetExperimentRunDetailsRequest.Validate if the designated +// constraints aren't met. +type GetExperimentRunDetailsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetExperimentRunDetailsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetExperimentRunDetailsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetExperimentRunDetailsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetExperimentRunDetailsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetExperimentRunDetailsRequestValidationError) ErrorName() string { + return "GetExperimentRunDetailsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetExperimentRunDetailsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetExperimentRunDetailsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetExperimentRunDetailsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetExperimentRunDetailsRequestValidationError{} + +// Validate checks the field values on GetExperimentRunDetailsResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetExperimentRunDetailsResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetRunDetails()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetExperimentRunDetailsResponseValidationError{ + field: "RunDetails", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// GetExperimentRunDetailsResponseValidationError is the validation error +// returned by GetExperimentRunDetailsResponse.Validate if the designated +// constraints aren't met. +type GetExperimentRunDetailsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetExperimentRunDetailsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetExperimentRunDetailsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetExperimentRunDetailsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetExperimentRunDetailsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetExperimentRunDetailsResponseValidationError) ErrorName() string { + return "GetExperimentRunDetailsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetExperimentRunDetailsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetExperimentRunDetailsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetExperimentRunDetailsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetExperimentRunDetailsResponseValidationError{} diff --git a/backend/api/chaos/experimentation/v1/list_view_item.pb.go b/backend/api/chaos/experimentation/v1/list_view_item.pb.go new file mode 100644 index 0000000000..670ef10395 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/list_view_item.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/experimentation/v1/list_view_item.proto + +package experimentationv1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// ListViewItem an abstraction for a list item. +type ListViewItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of a list item. + Identifier uint64 `protobuf:"varint,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // The properties map. + Properties *PropertiesMap `protobuf:"bytes,2,opt,name=properties,proto3" json:"properties,omitempty"` +} + +func (x *ListViewItem) Reset() { + *x = ListViewItem{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_list_view_item_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListViewItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListViewItem) ProtoMessage() {} + +func (x *ListViewItem) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_list_view_item_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListViewItem.ProtoReflect.Descriptor instead. +func (*ListViewItem) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_list_view_item_proto_rawDescGZIP(), []int{0} +} + +func (x *ListViewItem) GetIdentifier() uint64 { + if x != nil { + return x.Identifier + } + return 0 +} + +func (x *ListViewItem) GetProperties() *PropertiesMap { + if x != nil { + return x.Properties + } + return nil +} + +var File_chaos_experimentation_v1_list_view_item_proto protoreflect.FileDescriptor + +var file_chaos_experimentation_v1_list_view_item_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x76, 0x69, 0x65, 0x77, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x1f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x1a, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x42, 0x13, 0x5a, 0x11, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chaos_experimentation_v1_list_view_item_proto_rawDescOnce sync.Once + file_chaos_experimentation_v1_list_view_item_proto_rawDescData = file_chaos_experimentation_v1_list_view_item_proto_rawDesc +) + +func file_chaos_experimentation_v1_list_view_item_proto_rawDescGZIP() []byte { + file_chaos_experimentation_v1_list_view_item_proto_rawDescOnce.Do(func() { + file_chaos_experimentation_v1_list_view_item_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_experimentation_v1_list_view_item_proto_rawDescData) + }) + return file_chaos_experimentation_v1_list_view_item_proto_rawDescData +} + +var file_chaos_experimentation_v1_list_view_item_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_chaos_experimentation_v1_list_view_item_proto_goTypes = []interface{}{ + (*ListViewItem)(nil), // 0: clutch.chaos.experimentation.v1.ListViewItem + (*PropertiesMap)(nil), // 1: clutch.chaos.experimentation.v1.PropertiesMap +} +var file_chaos_experimentation_v1_list_view_item_proto_depIdxs = []int32{ + 1, // 0: clutch.chaos.experimentation.v1.ListViewItem.properties:type_name -> clutch.chaos.experimentation.v1.PropertiesMap + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_chaos_experimentation_v1_list_view_item_proto_init() } +func file_chaos_experimentation_v1_list_view_item_proto_init() { + if File_chaos_experimentation_v1_list_view_item_proto != nil { + return + } + file_chaos_experimentation_v1_properties_proto_init() + if !protoimpl.UnsafeEnabled { + file_chaos_experimentation_v1_list_view_item_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListViewItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_experimentation_v1_list_view_item_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chaos_experimentation_v1_list_view_item_proto_goTypes, + DependencyIndexes: file_chaos_experimentation_v1_list_view_item_proto_depIdxs, + MessageInfos: file_chaos_experimentation_v1_list_view_item_proto_msgTypes, + }.Build() + File_chaos_experimentation_v1_list_view_item_proto = out.File + file_chaos_experimentation_v1_list_view_item_proto_rawDesc = nil + file_chaos_experimentation_v1_list_view_item_proto_goTypes = nil + file_chaos_experimentation_v1_list_view_item_proto_depIdxs = nil +} diff --git a/backend/api/chaos/experimentation/v1/list_view_item.pb.validate.go b/backend/api/chaos/experimentation/v1/list_view_item.pb.validate.go new file mode 100644 index 0000000000..ac119c98f3 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/list_view_item.pb.validate.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/experimentation/v1/list_view_item.proto + +package experimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _list_view_item_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on ListViewItem with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ListViewItem) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Identifier + + if v, ok := interface{}(m.GetProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListViewItemValidationError{ + field: "Properties", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ListViewItemValidationError is the validation error returned by +// ListViewItem.Validate if the designated constraints aren't met. +type ListViewItemValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListViewItemValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListViewItemValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListViewItemValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListViewItemValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListViewItemValidationError) ErrorName() string { return "ListViewItemValidationError" } + +// Error satisfies the builtin error interface +func (e ListViewItemValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListViewItem.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListViewItemValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListViewItemValidationError{} diff --git a/backend/api/chaos/experimentation/v1/properties.pb.go b/backend/api/chaos/experimentation/v1/properties.pb.go new file mode 100644 index 0000000000..829bb81c00 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/properties.pb.go @@ -0,0 +1,400 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/experimentation/v1/properties.proto + +package experimentationv1 + +import ( + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type PropertiesList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ordered list of items. + Items []*Property `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *PropertiesList) Reset() { + *x = PropertiesList{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PropertiesList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PropertiesList) ProtoMessage() {} + +func (x *PropertiesList) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PropertiesList.ProtoReflect.Descriptor instead. +func (*PropertiesList) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_properties_proto_rawDescGZIP(), []int{0} +} + +func (x *PropertiesList) GetItems() []*Property { + if x != nil { + return x.Items + } + return nil +} + +type PropertiesMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unordered list of items that provides a fast random access to a property with a given identifier. + Items map[string]*Property `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PropertiesMap) Reset() { + *x = PropertiesMap{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PropertiesMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PropertiesMap) ProtoMessage() {} + +func (x *PropertiesMap) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PropertiesMap.ProtoReflect.Descriptor instead. +func (*PropertiesMap) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_properties_proto_rawDescGZIP(), []int{1} +} + +func (x *PropertiesMap) GetItems() map[string]*Property { + if x != nil { + return x.Items + } + return nil +} + +type Property struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of the property. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The human readable name of the property. + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + // The human readable value of the property. If it's not provided it's up to the caller to determine how + // to display the content of the `value` field of the property. + DisplayValue *wrappers.StringValue `protobuf:"bytes,3,opt,name=display_value,json=displayValue,proto3" json:"display_value,omitempty"` + // The value of the property. + // + // Types that are assignable to Value: + // *Property_DateValue + // *Property_StringValue + // *Property_IntValue + Value isProperty_Value `protobuf_oneof:"value"` +} + +func (x *Property) Reset() { + *x = Property{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Property) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Property) ProtoMessage() {} + +func (x *Property) ProtoReflect() protoreflect.Message { + mi := &file_chaos_experimentation_v1_properties_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Property.ProtoReflect.Descriptor instead. +func (*Property) Descriptor() ([]byte, []int) { + return file_chaos_experimentation_v1_properties_proto_rawDescGZIP(), []int{2} +} + +func (x *Property) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Property) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *Property) GetDisplayValue() *wrappers.StringValue { + if x != nil { + return x.DisplayValue + } + return nil +} + +func (m *Property) GetValue() isProperty_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Property) GetDateValue() *timestamp.Timestamp { + if x, ok := x.GetValue().(*Property_DateValue); ok { + return x.DateValue + } + return nil +} + +func (x *Property) GetStringValue() string { + if x, ok := x.GetValue().(*Property_StringValue); ok { + return x.StringValue + } + return "" +} + +func (x *Property) GetIntValue() int64 { + if x, ok := x.GetValue().(*Property_IntValue); ok { + return x.IntValue + } + return 0 +} + +type isProperty_Value interface { + isProperty_Value() +} + +type Property_DateValue struct { + DateValue *timestamp.Timestamp `protobuf:"bytes,4,opt,name=date_value,json=dateValue,proto3,oneof"` +} + +type Property_StringValue struct { + StringValue string `protobuf:"bytes,5,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type Property_IntValue struct { + IntValue int64 `protobuf:"varint,6,opt,name=int_value,json=intValue,proto3,oneof"` +} + +func (*Property_DateValue) isProperty_Value() {} + +func (*Property_StringValue) isProperty_Value() {} + +func (*Property_IntValue) isProperty_Value() {} + +var File_chaos_experimentation_v1_properties_proto protoreflect.FileDescriptor + +var file_chaos_experimentation_v1_properties_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, + 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x3f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x22, 0xc5, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x4d, + 0x61, 0x70, 0x12, 0x4f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, + 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x4d, 0x61, + 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x1a, 0x63, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, + 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfd, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x41, 0x0a, 0x0d, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, + 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, + 0x52, 0x09, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x65, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chaos_experimentation_v1_properties_proto_rawDescOnce sync.Once + file_chaos_experimentation_v1_properties_proto_rawDescData = file_chaos_experimentation_v1_properties_proto_rawDesc +) + +func file_chaos_experimentation_v1_properties_proto_rawDescGZIP() []byte { + file_chaos_experimentation_v1_properties_proto_rawDescOnce.Do(func() { + file_chaos_experimentation_v1_properties_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_experimentation_v1_properties_proto_rawDescData) + }) + return file_chaos_experimentation_v1_properties_proto_rawDescData +} + +var file_chaos_experimentation_v1_properties_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_chaos_experimentation_v1_properties_proto_goTypes = []interface{}{ + (*PropertiesList)(nil), // 0: clutch.chaos.experimentation.v1.PropertiesList + (*PropertiesMap)(nil), // 1: clutch.chaos.experimentation.v1.PropertiesMap + (*Property)(nil), // 2: clutch.chaos.experimentation.v1.Property + nil, // 3: clutch.chaos.experimentation.v1.PropertiesMap.ItemsEntry + (*wrappers.StringValue)(nil), // 4: google.protobuf.StringValue + (*timestamp.Timestamp)(nil), // 5: google.protobuf.Timestamp +} +var file_chaos_experimentation_v1_properties_proto_depIdxs = []int32{ + 2, // 0: clutch.chaos.experimentation.v1.PropertiesList.items:type_name -> clutch.chaos.experimentation.v1.Property + 3, // 1: clutch.chaos.experimentation.v1.PropertiesMap.items:type_name -> clutch.chaos.experimentation.v1.PropertiesMap.ItemsEntry + 4, // 2: clutch.chaos.experimentation.v1.Property.display_value:type_name -> google.protobuf.StringValue + 5, // 3: clutch.chaos.experimentation.v1.Property.date_value:type_name -> google.protobuf.Timestamp + 2, // 4: clutch.chaos.experimentation.v1.PropertiesMap.ItemsEntry.value:type_name -> clutch.chaos.experimentation.v1.Property + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_chaos_experimentation_v1_properties_proto_init() } +func file_chaos_experimentation_v1_properties_proto_init() { + if File_chaos_experimentation_v1_properties_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_chaos_experimentation_v1_properties_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PropertiesList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_properties_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PropertiesMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_experimentation_v1_properties_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Property); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_chaos_experimentation_v1_properties_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Property_DateValue)(nil), + (*Property_StringValue)(nil), + (*Property_IntValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_experimentation_v1_properties_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chaos_experimentation_v1_properties_proto_goTypes, + DependencyIndexes: file_chaos_experimentation_v1_properties_proto_depIdxs, + MessageInfos: file_chaos_experimentation_v1_properties_proto_msgTypes, + }.Build() + File_chaos_experimentation_v1_properties_proto = out.File + file_chaos_experimentation_v1_properties_proto_rawDesc = nil + file_chaos_experimentation_v1_properties_proto_goTypes = nil + file_chaos_experimentation_v1_properties_proto_depIdxs = nil +} diff --git a/backend/api/chaos/experimentation/v1/properties.pb.validate.go b/backend/api/chaos/experimentation/v1/properties.pb.validate.go new file mode 100644 index 0000000000..546ae7b797 --- /dev/null +++ b/backend/api/chaos/experimentation/v1/properties.pb.validate.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/experimentation/v1/properties.proto + +package experimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _properties_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on PropertiesList with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *PropertiesList) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PropertiesListValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// PropertiesListValidationError is the validation error returned by +// PropertiesList.Validate if the designated constraints aren't met. +type PropertiesListValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PropertiesListValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PropertiesListValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PropertiesListValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PropertiesListValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PropertiesListValidationError) ErrorName() string { return "PropertiesListValidationError" } + +// Error satisfies the builtin error interface +func (e PropertiesListValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPropertiesList.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PropertiesListValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PropertiesListValidationError{} + +// Validate checks the field values on PropertiesMap with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *PropertiesMap) Validate() error { + if m == nil { + return nil + } + + for key, val := range m.GetItems() { + _ = val + + // no validation rules for Items[key] + + if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PropertiesMapValidationError{ + field: fmt.Sprintf("Items[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// PropertiesMapValidationError is the validation error returned by +// PropertiesMap.Validate if the designated constraints aren't met. +type PropertiesMapValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PropertiesMapValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PropertiesMapValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PropertiesMapValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PropertiesMapValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PropertiesMapValidationError) ErrorName() string { return "PropertiesMapValidationError" } + +// Error satisfies the builtin error interface +func (e PropertiesMapValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPropertiesMap.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PropertiesMapValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PropertiesMapValidationError{} + +// Validate checks the field values on Property with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Property) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + // no validation rules for Label + + if v, ok := interface{}(m.GetDisplayValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PropertyValidationError{ + field: "DisplayValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + + switch m.Value.(type) { + + case *Property_DateValue: + + if v, ok := interface{}(m.GetDateValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PropertyValidationError{ + field: "DateValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Property_StringValue: + // no validation rules for StringValue + + case *Property_IntValue: + // no validation rules for IntValue + + } + + return nil +} + +// PropertyValidationError is the validation error returned by +// Property.Validate if the designated constraints aren't met. +type PropertyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PropertyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PropertyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PropertyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PropertyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PropertyValidationError) ErrorName() string { return "PropertyValidationError" } + +// Error satisfies the builtin error interface +func (e PropertyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProperty.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PropertyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PropertyValidationError{} diff --git a/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.go b/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.go new file mode 100644 index 0000000000..a973910562 --- /dev/null +++ b/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.go @@ -0,0 +1,471 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: chaos/serverexperimentation/v1/serverexperimentation.proto + +package serverexperimentationv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type TestConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Target: + // *TestConfig_ClusterPair + Target isTestConfig_Target `protobuf_oneof:"target"` + // Types that are assignable to Fault: + // *TestConfig_Abort + // *TestConfig_Latency + Fault isTestConfig_Fault `protobuf_oneof:"fault"` +} + +func (x *TestConfig) Reset() { + *x = TestConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestConfig) ProtoMessage() {} + +func (x *TestConfig) ProtoReflect() protoreflect.Message { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestConfig.ProtoReflect.Descriptor instead. +func (*TestConfig) Descriptor() ([]byte, []int) { + return file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescGZIP(), []int{0} +} + +func (m *TestConfig) GetTarget() isTestConfig_Target { + if m != nil { + return m.Target + } + return nil +} + +func (x *TestConfig) GetClusterPair() *ClusterPairTarget { + if x, ok := x.GetTarget().(*TestConfig_ClusterPair); ok { + return x.ClusterPair + } + return nil +} + +func (m *TestConfig) GetFault() isTestConfig_Fault { + if m != nil { + return m.Fault + } + return nil +} + +func (x *TestConfig) GetAbort() *AbortFaultConfig { + if x, ok := x.GetFault().(*TestConfig_Abort); ok { + return x.Abort + } + return nil +} + +func (x *TestConfig) GetLatency() *LatencyFaultConfig { + if x, ok := x.GetFault().(*TestConfig_Latency); ok { + return x.Latency + } + return nil +} + +type isTestConfig_Target interface { + isTestConfig_Target() +} + +type TestConfig_ClusterPair struct { + ClusterPair *ClusterPairTarget `protobuf:"bytes,1,opt,name=cluster_pair,json=clusterPair,proto3,oneof"` +} + +func (*TestConfig_ClusterPair) isTestConfig_Target() {} + +type isTestConfig_Fault interface { + isTestConfig_Fault() +} + +type TestConfig_Abort struct { + Abort *AbortFaultConfig `protobuf:"bytes,2,opt,name=abort,proto3,oneof"` +} + +type TestConfig_Latency struct { + Latency *LatencyFaultConfig `protobuf:"bytes,3,opt,name=latency,proto3,oneof"` +} + +func (*TestConfig_Abort) isTestConfig_Fault() {} + +func (*TestConfig_Latency) isTestConfig_Fault() {} + +// Targets requests from downstream_cluster -> upstream_cluster +type ClusterPairTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the downstream cluster + DownstreamCluster string `protobuf:"bytes,1,opt,name=downstream_cluster,json=downstreamCluster,proto3" json:"downstream_cluster,omitempty"` + // The name of the upstream cluster + UpstreamCluster string `protobuf:"bytes,2,opt,name=upstream_cluster,json=upstreamCluster,proto3" json:"upstream_cluster,omitempty"` +} + +func (x *ClusterPairTarget) Reset() { + *x = ClusterPairTarget{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterPairTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterPairTarget) ProtoMessage() {} + +func (x *ClusterPairTarget) ProtoReflect() protoreflect.Message { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterPairTarget.ProtoReflect.Descriptor instead. +func (*ClusterPairTarget) Descriptor() ([]byte, []int) { + return file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescGZIP(), []int{1} +} + +func (x *ClusterPairTarget) GetDownstreamCluster() string { + if x != nil { + return x.DownstreamCluster + } + return "" +} + +func (x *ClusterPairTarget) GetUpstreamCluster() string { + if x != nil { + return x.UpstreamCluster + } + return "" +} + +type AbortFaultConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The percentage of requests that will be slowed down. + Percent float32 `protobuf:"fixed32,1,opt,name=percent,proto3" json:"percent,omitempty"` + // The abort HTTP status that will be returned. + HttpStatus int32 `protobuf:"varint,2,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"` +} + +func (x *AbortFaultConfig) Reset() { + *x = AbortFaultConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AbortFaultConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AbortFaultConfig) ProtoMessage() {} + +func (x *AbortFaultConfig) ProtoReflect() protoreflect.Message { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AbortFaultConfig.ProtoReflect.Descriptor instead. +func (*AbortFaultConfig) Descriptor() ([]byte, []int) { + return file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescGZIP(), []int{2} +} + +func (x *AbortFaultConfig) GetPercent() float32 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *AbortFaultConfig) GetHttpStatus() int32 { + if x != nil { + return x.HttpStatus + } + return 0 +} + +type LatencyFaultConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The percentage of requests that will be slowed down. + Percent float32 `protobuf:"fixed32,1,opt,name=percent,proto3" json:"percent,omitempty"` + // The latency duration in milliseconds. + DurationMs int32 `protobuf:"varint,2,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"` +} + +func (x *LatencyFaultConfig) Reset() { + *x = LatencyFaultConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LatencyFaultConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LatencyFaultConfig) ProtoMessage() {} + +func (x *LatencyFaultConfig) ProtoReflect() protoreflect.Message { + mi := &file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LatencyFaultConfig.ProtoReflect.Descriptor instead. +func (*LatencyFaultConfig) Descriptor() ([]byte, []int) { + return file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescGZIP(), []int{3} +} + +func (x *LatencyFaultConfig) GetPercent() float32 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *LatencyFaultConfig) GetDurationMs() int32 { + if x != nil { + return x.DurationMs + } + return 0 +} + +var File_chaos_serverexperimentation_v1_serverexperimentation_proto protoreflect.FileDescriptor + +var file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDesc = []byte{ + 0x0a, 0x3a, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x02, 0x0a, + 0x0a, 0x54, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5d, 0x0a, 0x0c, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x50, 0x61, 0x69, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x4f, 0x0a, 0x05, 0x61, 0x62, + 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x48, 0x01, 0x52, 0x05, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x12, 0x55, 0x0a, 0x07, 0x6c, + 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x46, 0x61, 0x75, 0x6c, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x01, 0x52, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, + 0x63, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x07, 0x0a, 0x05, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x7f, 0x0a, 0x11, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x50, 0x61, 0x69, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x12, 0x64, 0x6f, + 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, + 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x32, 0x0a, 0x10, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0f, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x10, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x46, + 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x07, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0f, 0xfa, 0x42, 0x0c, + 0x0a, 0x0a, 0x1d, 0x00, 0x00, 0xc8, 0x42, 0x25, 0x00, 0x00, 0x00, 0x00, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, + 0x05, 0x10, 0xd8, 0x04, 0x20, 0x63, 0x52, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x69, 0x0a, 0x12, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x46, 0x61, 0x75, + 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x0a, 0x0a, + 0x1d, 0x00, 0x00, 0xc8, 0x42, 0x25, 0x00, 0x00, 0x00, 0x00, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x20, + 0x00, 0x52, 0x0a, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x42, 0x19, 0x5a, + 0x17, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescOnce sync.Once + file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescData = file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDesc +) + +func file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescGZIP() []byte { + file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescOnce.Do(func() { + file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescData = protoimpl.X.CompressGZIP(file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescData) + }) + return file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDescData +} + +var file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_chaos_serverexperimentation_v1_serverexperimentation_proto_goTypes = []interface{}{ + (*TestConfig)(nil), // 0: clutch.chaos.serverexperimentation.v1.TestConfig + (*ClusterPairTarget)(nil), // 1: clutch.chaos.serverexperimentation.v1.ClusterPairTarget + (*AbortFaultConfig)(nil), // 2: clutch.chaos.serverexperimentation.v1.AbortFaultConfig + (*LatencyFaultConfig)(nil), // 3: clutch.chaos.serverexperimentation.v1.LatencyFaultConfig +} +var file_chaos_serverexperimentation_v1_serverexperimentation_proto_depIdxs = []int32{ + 1, // 0: clutch.chaos.serverexperimentation.v1.TestConfig.cluster_pair:type_name -> clutch.chaos.serverexperimentation.v1.ClusterPairTarget + 2, // 1: clutch.chaos.serverexperimentation.v1.TestConfig.abort:type_name -> clutch.chaos.serverexperimentation.v1.AbortFaultConfig + 3, // 2: clutch.chaos.serverexperimentation.v1.TestConfig.latency:type_name -> clutch.chaos.serverexperimentation.v1.LatencyFaultConfig + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_chaos_serverexperimentation_v1_serverexperimentation_proto_init() } +func file_chaos_serverexperimentation_v1_serverexperimentation_proto_init() { + if File_chaos_serverexperimentation_v1_serverexperimentation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterPairTarget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AbortFaultConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LatencyFaultConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*TestConfig_ClusterPair)(nil), + (*TestConfig_Abort)(nil), + (*TestConfig_Latency)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_chaos_serverexperimentation_v1_serverexperimentation_proto_goTypes, + DependencyIndexes: file_chaos_serverexperimentation_v1_serverexperimentation_proto_depIdxs, + MessageInfos: file_chaos_serverexperimentation_v1_serverexperimentation_proto_msgTypes, + }.Build() + File_chaos_serverexperimentation_v1_serverexperimentation_proto = out.File + file_chaos_serverexperimentation_v1_serverexperimentation_proto_rawDesc = nil + file_chaos_serverexperimentation_v1_serverexperimentation_proto_goTypes = nil + file_chaos_serverexperimentation_v1_serverexperimentation_proto_depIdxs = nil +} diff --git a/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.validate.go b/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.validate.go new file mode 100644 index 0000000000..7f7c872df0 --- /dev/null +++ b/backend/api/chaos/serverexperimentation/v1/serverexperimentation.pb.validate.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: chaos/serverexperimentation/v1/serverexperimentation.proto + +package serverexperimentationv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _serverexperimentation_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on TestConfig with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *TestConfig) Validate() error { + if m == nil { + return nil + } + + switch m.Target.(type) { + + case *TestConfig_ClusterPair: + + if v, ok := interface{}(m.GetClusterPair()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TestConfigValidationError{ + field: "ClusterPair", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + switch m.Fault.(type) { + + case *TestConfig_Abort: + + if v, ok := interface{}(m.GetAbort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TestConfigValidationError{ + field: "Abort", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *TestConfig_Latency: + + if v, ok := interface{}(m.GetLatency()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TestConfigValidationError{ + field: "Latency", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// TestConfigValidationError is the validation error returned by +// TestConfig.Validate if the designated constraints aren't met. +type TestConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TestConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TestConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TestConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TestConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TestConfigValidationError) ErrorName() string { return "TestConfigValidationError" } + +// Error satisfies the builtin error interface +func (e TestConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTestConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TestConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TestConfigValidationError{} + +// Validate checks the field values on ClusterPairTarget with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ClusterPairTarget) Validate() error { + if m == nil { + return nil + } + + if len(m.GetDownstreamCluster()) < 1 { + return ClusterPairTargetValidationError{ + field: "DownstreamCluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetUpstreamCluster()) < 1 { + return ClusterPairTargetValidationError{ + field: "UpstreamCluster", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// ClusterPairTargetValidationError is the validation error returned by +// ClusterPairTarget.Validate if the designated constraints aren't met. +type ClusterPairTargetValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClusterPairTargetValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClusterPairTargetValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClusterPairTargetValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClusterPairTargetValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClusterPairTargetValidationError) ErrorName() string { + return "ClusterPairTargetValidationError" +} + +// Error satisfies the builtin error interface +func (e ClusterPairTargetValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClusterPairTarget.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClusterPairTargetValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClusterPairTargetValidationError{} + +// Validate checks the field values on AbortFaultConfig with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AbortFaultConfig) Validate() error { + if m == nil { + return nil + } + + if val := m.GetPercent(); val <= 0 || val > 100 { + return AbortFaultConfigValidationError{ + field: "Percent", + reason: "value must be inside range (0, 100]", + } + } + + if val := m.GetHttpStatus(); val <= 99 || val >= 600 { + return AbortFaultConfigValidationError{ + field: "HttpStatus", + reason: "value must be inside range (99, 600)", + } + } + + return nil +} + +// AbortFaultConfigValidationError is the validation error returned by +// AbortFaultConfig.Validate if the designated constraints aren't met. +type AbortFaultConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AbortFaultConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AbortFaultConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AbortFaultConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AbortFaultConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AbortFaultConfigValidationError) ErrorName() string { return "AbortFaultConfigValidationError" } + +// Error satisfies the builtin error interface +func (e AbortFaultConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAbortFaultConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AbortFaultConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AbortFaultConfigValidationError{} + +// Validate checks the field values on LatencyFaultConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *LatencyFaultConfig) Validate() error { + if m == nil { + return nil + } + + if val := m.GetPercent(); val <= 0 || val > 100 { + return LatencyFaultConfigValidationError{ + field: "Percent", + reason: "value must be inside range (0, 100]", + } + } + + if m.GetDurationMs() <= 0 { + return LatencyFaultConfigValidationError{ + field: "DurationMs", + reason: "value must be greater than 0", + } + } + + return nil +} + +// LatencyFaultConfigValidationError is the validation error returned by +// LatencyFaultConfig.Validate if the designated constraints aren't met. +type LatencyFaultConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LatencyFaultConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LatencyFaultConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LatencyFaultConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LatencyFaultConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LatencyFaultConfigValidationError) ErrorName() string { + return "LatencyFaultConfigValidationError" +} + +// Error satisfies the builtin error interface +func (e LatencyFaultConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLatencyFaultConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LatencyFaultConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LatencyFaultConfigValidationError{} diff --git a/backend/api/config/gateway/v1/gateway.pb.go b/backend/api/config/gateway/v1/gateway.pb.go new file mode 100644 index 0000000000..fa579e93b4 --- /dev/null +++ b/backend/api/config/gateway/v1/gateway.pb.go @@ -0,0 +1,1670 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/gateway/v1/gateway.proto + +package gatewayv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + duration "github.com/golang/protobuf/ptypes/duration" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Logger_Level int32 + +const ( + Logger_UNSPECIFIED Logger_Level = 0 + Logger_DEBUG Logger_Level = 1 + Logger_INFO Logger_Level = 2 + Logger_WARN Logger_Level = 3 + Logger_ERROR Logger_Level = 4 + Logger_PANIC Logger_Level = 5 + Logger_FATAL Logger_Level = 6 +) + +// Enum value maps for Logger_Level. +var ( + Logger_Level_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "DEBUG", + 2: "INFO", + 3: "WARN", + 4: "ERROR", + 5: "PANIC", + 6: "FATAL", + } + Logger_Level_value = map[string]int32{ + "UNSPECIFIED": 0, + "DEBUG": 1, + "INFO": 2, + "WARN": 3, + "ERROR": 4, + "PANIC": 5, + "FATAL": 6, + } +) + +func (x Logger_Level) Enum() *Logger_Level { + p := new(Logger_Level) + *p = x + return p +} + +func (x Logger_Level) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Logger_Level) Descriptor() protoreflect.EnumDescriptor { + return file_config_gateway_v1_gateway_proto_enumTypes[0].Descriptor() +} + +func (Logger_Level) Type() protoreflect.EnumType { + return &file_config_gateway_v1_gateway_proto_enumTypes[0] +} + +func (x Logger_Level) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Logger_Level.Descriptor instead. +func (Logger_Level) EnumDescriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{7, 0} +} + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Gateway *GatewayOptions `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway,omitempty"` + Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"` + Resolvers []*Resolver `protobuf:"bytes,3,rep,name=resolvers,proto3" json:"resolvers,omitempty"` + Modules []*Module `protobuf:"bytes,4,rep,name=modules,proto3" json:"modules,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetGateway() *GatewayOptions { + if x != nil { + return x.Gateway + } + return nil +} + +func (x *Config) GetServices() []*Service { + if x != nil { + return x.Services + } + return nil +} + +func (x *Config) GetResolvers() []*Resolver { + if x != nil { + return x.Resolvers + } + return nil +} + +func (x *Config) GetModules() []*Module { + if x != nil { + return x.Modules + } + return nil +} + +type TCPSocket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + Secure bool `protobuf:"varint,3,opt,name=secure,proto3" json:"secure,omitempty"` +} + +func (x *TCPSocket) Reset() { + *x = TCPSocket{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TCPSocket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TCPSocket) ProtoMessage() {} + +func (x *TCPSocket) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TCPSocket.ProtoReflect.Descriptor instead. +func (*TCPSocket) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{1} +} + +func (x *TCPSocket) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *TCPSocket) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *TCPSocket) GetSecure() bool { + if x != nil { + return x.Secure + } + return false +} + +type Listener struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Socket: + // *Listener_Tcp + Socket isListener_Socket `protobuf_oneof:"socket"` +} + +func (x *Listener) Reset() { + *x = Listener{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Listener) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Listener) ProtoMessage() {} + +func (x *Listener) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Listener.ProtoReflect.Descriptor instead. +func (*Listener) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{2} +} + +func (m *Listener) GetSocket() isListener_Socket { + if m != nil { + return m.Socket + } + return nil +} + +func (x *Listener) GetTcp() *TCPSocket { + if x, ok := x.GetSocket().(*Listener_Tcp); ok { + return x.Tcp + } + return nil +} + +type isListener_Socket interface { + isListener_Socket() +} + +type Listener_Tcp struct { + Tcp *TCPSocket `protobuf:"bytes,1,opt,name=tcp,proto3,oneof"` +} + +func (*Listener_Tcp) isListener_Socket() {} + +type Stats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Counters, gauges and histograms (i.e. everything except timers) are buffered at the specified interval. + FlushInterval *duration.Duration `protobuf:"bytes,1,opt,name=flush_interval,json=flushInterval,proto3" json:"flush_interval,omitempty"` + // The reporter to emit stats. If none specified, then stats will not be reported. + // + // Types that are assignable to Reporter: + // *Stats_LogReporter_ + // *Stats_StatsdReporter_ + Reporter isStats_Reporter `protobuf_oneof:"reporter"` +} + +func (x *Stats) Reset() { + *x = Stats{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats) ProtoMessage() {} + +func (x *Stats) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats.ProtoReflect.Descriptor instead. +func (*Stats) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{3} +} + +func (x *Stats) GetFlushInterval() *duration.Duration { + if x != nil { + return x.FlushInterval + } + return nil +} + +func (m *Stats) GetReporter() isStats_Reporter { + if m != nil { + return m.Reporter + } + return nil +} + +func (x *Stats) GetLogReporter() *Stats_LogReporter { + if x, ok := x.GetReporter().(*Stats_LogReporter_); ok { + return x.LogReporter + } + return nil +} + +func (x *Stats) GetStatsdReporter() *Stats_StatsdReporter { + if x, ok := x.GetReporter().(*Stats_StatsdReporter_); ok { + return x.StatsdReporter + } + return nil +} + +type isStats_Reporter interface { + isStats_Reporter() +} + +type Stats_LogReporter_ struct { + LogReporter *Stats_LogReporter `protobuf:"bytes,2,opt,name=log_reporter,json=logReporter,proto3,oneof"` +} + +type Stats_StatsdReporter_ struct { + StatsdReporter *Stats_StatsdReporter `protobuf:"bytes,3,opt,name=statsd_reporter,json=statsdReporter,proto3,oneof"` // TODO: Prometheus support. +} + +func (*Stats_LogReporter_) isStats_Reporter() {} + +func (*Stats_StatsdReporter_) isStats_Reporter() {} + +type Timeouts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Default timeout to apply to all requests. + Default *duration.Duration `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"` + Overrides []*Timeouts_Entry `protobuf:"bytes,2,rep,name=overrides,proto3" json:"overrides,omitempty"` +} + +func (x *Timeouts) Reset() { + *x = Timeouts{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Timeouts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Timeouts) ProtoMessage() {} + +func (x *Timeouts) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Timeouts.ProtoReflect.Descriptor instead. +func (*Timeouts) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{4} +} + +func (x *Timeouts) GetDefault() *duration.Duration { + if x != nil { + return x.Default + } + return nil +} + +func (x *Timeouts) GetOverrides() []*Timeouts_Entry { + if x != nil { + return x.Overrides + } + return nil +} + +type GatewayOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Listener *Listener `protobuf:"bytes,1,opt,name=listener,proto3" json:"listener,omitempty"` + JsonGrpcLoopbackListener *Listener `protobuf:"bytes,2,opt,name=json_grpc_loopback_listener,json=jsonGrpcLoopbackListener,proto3" json:"json_grpc_loopback_listener,omitempty"` + Logger *Logger `protobuf:"bytes,3,opt,name=logger,proto3" json:"logger,omitempty"` + Stats *Stats `protobuf:"bytes,4,opt,name=stats,proto3" json:"stats,omitempty"` + Timeouts *Timeouts `protobuf:"bytes,5,opt,name=timeouts,proto3" json:"timeouts,omitempty"` + Middleware []*Middleware `protobuf:"bytes,6,rep,name=middleware,proto3" json:"middleware,omitempty"` + Assets *Assets `protobuf:"bytes,7,opt,name=assets,proto3" json:"assets,omitempty"` +} + +func (x *GatewayOptions) Reset() { + *x = GatewayOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GatewayOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GatewayOptions) ProtoMessage() {} + +func (x *GatewayOptions) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GatewayOptions.ProtoReflect.Descriptor instead. +func (*GatewayOptions) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{5} +} + +func (x *GatewayOptions) GetListener() *Listener { + if x != nil { + return x.Listener + } + return nil +} + +func (x *GatewayOptions) GetJsonGrpcLoopbackListener() *Listener { + if x != nil { + return x.JsonGrpcLoopbackListener + } + return nil +} + +func (x *GatewayOptions) GetLogger() *Logger { + if x != nil { + return x.Logger + } + return nil +} + +func (x *GatewayOptions) GetStats() *Stats { + if x != nil { + return x.Stats + } + return nil +} + +func (x *GatewayOptions) GetTimeouts() *Timeouts { + if x != nil { + return x.Timeouts + } + return nil +} + +func (x *GatewayOptions) GetMiddleware() []*Middleware { + if x != nil { + return x.Middleware + } + return nil +} + +func (x *GatewayOptions) GetAssets() *Assets { + if x != nil { + return x.Assets + } + return nil +} + +// Assets configuration provide a passthrough host for frontend static assets. +// This is useful if you dont have the ability to enable sticky sessions or a blue/green deploy system in place. +type Assets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // *Assets_S3 + Provider isAssets_Provider `protobuf_oneof:"provider"` +} + +func (x *Assets) Reset() { + *x = Assets{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Assets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Assets) ProtoMessage() {} + +func (x *Assets) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Assets.ProtoReflect.Descriptor instead. +func (*Assets) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{6} +} + +func (m *Assets) GetProvider() isAssets_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *Assets) GetS3() *Assets_S3Provider { + if x, ok := x.GetProvider().(*Assets_S3); ok { + return x.S3 + } + return nil +} + +type isAssets_Provider interface { + isAssets_Provider() +} + +type Assets_S3 struct { + S3 *Assets_S3Provider `protobuf:"bytes,1,opt,name=s3,proto3,oneof"` +} + +func (*Assets_S3) isAssets_Provider() {} + +type Logger struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level Logger_Level `protobuf:"varint,1,opt,name=level,proto3,enum=clutch.config.gateway.v1.Logger_Level" json:"level,omitempty"` + // Types that are assignable to Format: + // *Logger_Pretty + Format isLogger_Format `protobuf_oneof:"format"` +} + +func (x *Logger) Reset() { + *x = Logger{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Logger) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Logger) ProtoMessage() {} + +func (x *Logger) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Logger.ProtoReflect.Descriptor instead. +func (*Logger) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{7} +} + +func (x *Logger) GetLevel() Logger_Level { + if x != nil { + return x.Level + } + return Logger_UNSPECIFIED +} + +func (m *Logger) GetFormat() isLogger_Format { + if m != nil { + return m.Format + } + return nil +} + +func (x *Logger) GetPretty() bool { + if x, ok := x.GetFormat().(*Logger_Pretty); ok { + return x.Pretty + } + return false +} + +type isLogger_Format interface { + isLogger_Format() +} + +type Logger_Pretty struct { + Pretty bool `protobuf:"varint,2,opt,name=pretty,proto3,oneof"` +} + +func (*Logger_Pretty) isLogger_Format() {} + +type Middleware struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + TypedConfig *any.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"` +} + +func (x *Middleware) Reset() { + *x = Middleware{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Middleware) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Middleware) ProtoMessage() {} + +func (x *Middleware) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Middleware.ProtoReflect.Descriptor instead. +func (*Middleware) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{8} +} + +func (x *Middleware) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Middleware) GetTypedConfig() *any.Any { + if x != nil { + return x.TypedConfig + } + return nil +} + +type Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + TypedConfig *any.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"` +} + +func (x *Service) Reset() { + *x = Service{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Service) ProtoMessage() {} + +func (x *Service) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Service.ProtoReflect.Descriptor instead. +func (*Service) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{9} +} + +func (x *Service) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Service) GetTypedConfig() *any.Any { + if x != nil { + return x.TypedConfig + } + return nil +} + +type Resolver struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + TypedConfig *any.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"` +} + +func (x *Resolver) Reset() { + *x = Resolver{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Resolver) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Resolver) ProtoMessage() {} + +func (x *Resolver) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Resolver.ProtoReflect.Descriptor instead. +func (*Resolver) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{10} +} + +func (x *Resolver) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Resolver) GetTypedConfig() *any.Any { + if x != nil { + return x.TypedConfig + } + return nil +} + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + TypedConfig *any.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +func (x *Module) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{11} +} + +func (x *Module) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Module) GetTypedConfig() *any.Any { + if x != nil { + return x.TypedConfig + } + return nil +} + +type Stats_LogReporter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Stats_LogReporter) Reset() { + *x = Stats_LogReporter{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats_LogReporter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats_LogReporter) ProtoMessage() {} + +func (x *Stats_LogReporter) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats_LogReporter.ProtoReflect.Descriptor instead. +func (*Stats_LogReporter) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{3, 0} +} + +type Stats_StatsdReporter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Types that are assignable to TagMode: + // *Stats_StatsdReporter_PointTags_ + TagMode isStats_StatsdReporter_TagMode `protobuf_oneof:"tag_mode"` +} + +func (x *Stats_StatsdReporter) Reset() { + *x = Stats_StatsdReporter{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats_StatsdReporter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats_StatsdReporter) ProtoMessage() {} + +func (x *Stats_StatsdReporter) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats_StatsdReporter.ProtoReflect.Descriptor instead. +func (*Stats_StatsdReporter) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *Stats_StatsdReporter) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (m *Stats_StatsdReporter) GetTagMode() isStats_StatsdReporter_TagMode { + if m != nil { + return m.TagMode + } + return nil +} + +func (x *Stats_StatsdReporter) GetPointTags() *Stats_StatsdReporter_PointTags { + if x, ok := x.GetTagMode().(*Stats_StatsdReporter_PointTags_); ok { + return x.PointTags + } + return nil +} + +type isStats_StatsdReporter_TagMode interface { + isStats_StatsdReporter_TagMode() +} + +type Stats_StatsdReporter_PointTags_ struct { + PointTags *Stats_StatsdReporter_PointTags `protobuf:"bytes,2,opt,name=point_tags,json=pointTags,proto3,oneof"` +} + +func (*Stats_StatsdReporter_PointTags_) isStats_StatsdReporter_TagMode() {} + +type Stats_StatsdReporter_PointTags struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Separator string `protobuf:"bytes,1,opt,name=separator,proto3" json:"separator,omitempty"` +} + +func (x *Stats_StatsdReporter_PointTags) Reset() { + *x = Stats_StatsdReporter_PointTags{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats_StatsdReporter_PointTags) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats_StatsdReporter_PointTags) ProtoMessage() {} + +func (x *Stats_StatsdReporter_PointTags) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats_StatsdReporter_PointTags.ProtoReflect.Descriptor instead. +func (*Stats_StatsdReporter_PointTags) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{3, 1, 0} +} + +func (x *Stats_StatsdReporter_PointTags) GetSeparator() string { + if x != nil { + return x.Separator + } + return "" +} + +type Timeouts_Entry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + Timeout *duration.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *Timeouts_Entry) Reset() { + *x = Timeouts_Entry{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Timeouts_Entry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Timeouts_Entry) ProtoMessage() {} + +func (x *Timeouts_Entry) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Timeouts_Entry.ProtoReflect.Descriptor instead. +func (*Timeouts_Entry) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Timeouts_Entry) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Timeouts_Entry) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Timeouts_Entry) GetTimeout() *duration.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// To use the S3Provider you must have the AWS service configured +type Assets_S3Provider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` + Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` + // key is the path to clutchs frontend static assets in the configured bucket + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *Assets_S3Provider) Reset() { + *x = Assets_S3Provider{} + if protoimpl.UnsafeEnabled { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Assets_S3Provider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Assets_S3Provider) ProtoMessage() {} + +func (x *Assets_S3Provider) ProtoReflect() protoreflect.Message { + mi := &file_config_gateway_v1_gateway_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Assets_S3Provider.ProtoReflect.Descriptor instead. +func (*Assets_S3Provider) Descriptor() ([]byte, []int) { + return file_config_gateway_v1_gateway_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *Assets_S3Provider) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *Assets_S3Provider) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *Assets_S3Provider) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +var File_config_gateway_v1_gateway_proto protoreflect.FileDescriptor + +var file_config_gateway_v1_gateway_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x18, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x93, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4c, 0x0a, 0x07, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x3d, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x52, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x65, 0x0a, 0x09, 0x54, 0x43, 0x50, 0x53, 0x6f, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x18, 0xff, 0xff, 0x03, 0x52, 0x04, + 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x22, 0x52, 0x0a, 0x08, + 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x03, 0x74, 0x63, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x43, 0x50, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x74, 0x63, + 0x70, 0x42, 0x0d, 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, + 0x22, 0xe8, 0x03, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x66, 0x6c, + 0x75, 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xfa, + 0x42, 0x0a, 0xaa, 0x01, 0x07, 0x32, 0x05, 0x10, 0x80, 0xc2, 0xd7, 0x2f, 0x52, 0x0d, 0x66, 0x6c, + 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x50, 0x0a, 0x0c, 0x6c, + 0x6f, 0x67, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x59, 0x0a, + 0x0f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x1a, 0x0d, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x1a, 0xc5, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x74, 0x61, + 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x64, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, + 0x67, 0x73, 0x48, 0x00, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x73, 0x1a, + 0x32, 0x0a, 0x09, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x25, 0x0a, 0x09, + 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x74, 0x61, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x42, + 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x93, 0x02, 0x0a, 0x08, + 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0xaa, 0x01, 0x06, 0x08, 0x01, 0x32, 0x02, + 0x08, 0x01, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x6f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, + 0x64, 0x65, 0x73, 0x1a, 0x7c, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x41, + 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0xaa, + 0x01, 0x06, 0x08, 0x01, 0x32, 0x02, 0x08, 0x01, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x22, 0x82, 0x04, 0x0a, 0x0e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x61, + 0x0a, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x6f, 0x70, + 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x52, 0x18, 0x6a, 0x73, 0x6f, 0x6e, 0x47, 0x72, 0x70, + 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, + 0x72, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, + 0x67, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6c, + 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x73, 0x52, 0x08, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x38, 0x0a, 0x06, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x06, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x12, 0x3d, 0x0a, 0x02, 0x73, 0x33, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, + 0x53, 0x33, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x02, 0x73, 0x33, + 0x1a, 0x4e, 0x0a, 0x0a, 0x53, 0x33, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0xc4, 0x01, 0x0a, + 0x06, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x22, + 0x58, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, + 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x08, + 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x41, 0x4e, 0x49, 0x43, 0x10, 0x05, 0x12, 0x09, + 0x0a, 0x05, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x06, 0x42, 0x08, 0x0a, 0x06, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x22, 0x62, 0x0a, 0x0a, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, + 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, + 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, + 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x5f, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x37, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, 0x79, 0x70, + 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x60, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x5e, 0x0a, 0x06, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0b, 0x5a, 0x09, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_gateway_v1_gateway_proto_rawDescOnce sync.Once + file_config_gateway_v1_gateway_proto_rawDescData = file_config_gateway_v1_gateway_proto_rawDesc +) + +func file_config_gateway_v1_gateway_proto_rawDescGZIP() []byte { + file_config_gateway_v1_gateway_proto_rawDescOnce.Do(func() { + file_config_gateway_v1_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_gateway_v1_gateway_proto_rawDescData) + }) + return file_config_gateway_v1_gateway_proto_rawDescData +} + +var file_config_gateway_v1_gateway_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_config_gateway_v1_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_config_gateway_v1_gateway_proto_goTypes = []interface{}{ + (Logger_Level)(0), // 0: clutch.config.gateway.v1.Logger.Level + (*Config)(nil), // 1: clutch.config.gateway.v1.Config + (*TCPSocket)(nil), // 2: clutch.config.gateway.v1.TCPSocket + (*Listener)(nil), // 3: clutch.config.gateway.v1.Listener + (*Stats)(nil), // 4: clutch.config.gateway.v1.Stats + (*Timeouts)(nil), // 5: clutch.config.gateway.v1.Timeouts + (*GatewayOptions)(nil), // 6: clutch.config.gateway.v1.GatewayOptions + (*Assets)(nil), // 7: clutch.config.gateway.v1.Assets + (*Logger)(nil), // 8: clutch.config.gateway.v1.Logger + (*Middleware)(nil), // 9: clutch.config.gateway.v1.Middleware + (*Service)(nil), // 10: clutch.config.gateway.v1.Service + (*Resolver)(nil), // 11: clutch.config.gateway.v1.Resolver + (*Module)(nil), // 12: clutch.config.gateway.v1.Module + (*Stats_LogReporter)(nil), // 13: clutch.config.gateway.v1.Stats.LogReporter + (*Stats_StatsdReporter)(nil), // 14: clutch.config.gateway.v1.Stats.StatsdReporter + (*Stats_StatsdReporter_PointTags)(nil), // 15: clutch.config.gateway.v1.Stats.StatsdReporter.PointTags + (*Timeouts_Entry)(nil), // 16: clutch.config.gateway.v1.Timeouts.Entry + (*Assets_S3Provider)(nil), // 17: clutch.config.gateway.v1.Assets.S3Provider + (*duration.Duration)(nil), // 18: google.protobuf.Duration + (*any.Any)(nil), // 19: google.protobuf.Any +} +var file_config_gateway_v1_gateway_proto_depIdxs = []int32{ + 6, // 0: clutch.config.gateway.v1.Config.gateway:type_name -> clutch.config.gateway.v1.GatewayOptions + 10, // 1: clutch.config.gateway.v1.Config.services:type_name -> clutch.config.gateway.v1.Service + 11, // 2: clutch.config.gateway.v1.Config.resolvers:type_name -> clutch.config.gateway.v1.Resolver + 12, // 3: clutch.config.gateway.v1.Config.modules:type_name -> clutch.config.gateway.v1.Module + 2, // 4: clutch.config.gateway.v1.Listener.tcp:type_name -> clutch.config.gateway.v1.TCPSocket + 18, // 5: clutch.config.gateway.v1.Stats.flush_interval:type_name -> google.protobuf.Duration + 13, // 6: clutch.config.gateway.v1.Stats.log_reporter:type_name -> clutch.config.gateway.v1.Stats.LogReporter + 14, // 7: clutch.config.gateway.v1.Stats.statsd_reporter:type_name -> clutch.config.gateway.v1.Stats.StatsdReporter + 18, // 8: clutch.config.gateway.v1.Timeouts.default:type_name -> google.protobuf.Duration + 16, // 9: clutch.config.gateway.v1.Timeouts.overrides:type_name -> clutch.config.gateway.v1.Timeouts.Entry + 3, // 10: clutch.config.gateway.v1.GatewayOptions.listener:type_name -> clutch.config.gateway.v1.Listener + 3, // 11: clutch.config.gateway.v1.GatewayOptions.json_grpc_loopback_listener:type_name -> clutch.config.gateway.v1.Listener + 8, // 12: clutch.config.gateway.v1.GatewayOptions.logger:type_name -> clutch.config.gateway.v1.Logger + 4, // 13: clutch.config.gateway.v1.GatewayOptions.stats:type_name -> clutch.config.gateway.v1.Stats + 5, // 14: clutch.config.gateway.v1.GatewayOptions.timeouts:type_name -> clutch.config.gateway.v1.Timeouts + 9, // 15: clutch.config.gateway.v1.GatewayOptions.middleware:type_name -> clutch.config.gateway.v1.Middleware + 7, // 16: clutch.config.gateway.v1.GatewayOptions.assets:type_name -> clutch.config.gateway.v1.Assets + 17, // 17: clutch.config.gateway.v1.Assets.s3:type_name -> clutch.config.gateway.v1.Assets.S3Provider + 0, // 18: clutch.config.gateway.v1.Logger.level:type_name -> clutch.config.gateway.v1.Logger.Level + 19, // 19: clutch.config.gateway.v1.Middleware.typed_config:type_name -> google.protobuf.Any + 19, // 20: clutch.config.gateway.v1.Service.typed_config:type_name -> google.protobuf.Any + 19, // 21: clutch.config.gateway.v1.Resolver.typed_config:type_name -> google.protobuf.Any + 19, // 22: clutch.config.gateway.v1.Module.typed_config:type_name -> google.protobuf.Any + 15, // 23: clutch.config.gateway.v1.Stats.StatsdReporter.point_tags:type_name -> clutch.config.gateway.v1.Stats.StatsdReporter.PointTags + 18, // 24: clutch.config.gateway.v1.Timeouts.Entry.timeout:type_name -> google.protobuf.Duration + 25, // [25:25] is the sub-list for method output_type + 25, // [25:25] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name +} + +func init() { file_config_gateway_v1_gateway_proto_init() } +func file_config_gateway_v1_gateway_proto_init() { + if File_config_gateway_v1_gateway_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_gateway_v1_gateway_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TCPSocket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Listener); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Timeouts); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GatewayOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Assets); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Logger); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Middleware); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Resolver); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats_LogReporter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats_StatsdReporter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats_StatsdReporter_PointTags); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Timeouts_Entry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_gateway_v1_gateway_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Assets_S3Provider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_gateway_v1_gateway_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Listener_Tcp)(nil), + } + file_config_gateway_v1_gateway_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Stats_LogReporter_)(nil), + (*Stats_StatsdReporter_)(nil), + } + file_config_gateway_v1_gateway_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*Assets_S3)(nil), + } + file_config_gateway_v1_gateway_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*Logger_Pretty)(nil), + } + file_config_gateway_v1_gateway_proto_msgTypes[13].OneofWrappers = []interface{}{ + (*Stats_StatsdReporter_PointTags_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_gateway_v1_gateway_proto_rawDesc, + NumEnums: 1, + NumMessages: 17, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_gateway_v1_gateway_proto_goTypes, + DependencyIndexes: file_config_gateway_v1_gateway_proto_depIdxs, + EnumInfos: file_config_gateway_v1_gateway_proto_enumTypes, + MessageInfos: file_config_gateway_v1_gateway_proto_msgTypes, + }.Build() + File_config_gateway_v1_gateway_proto = out.File + file_config_gateway_v1_gateway_proto_rawDesc = nil + file_config_gateway_v1_gateway_proto_goTypes = nil + file_config_gateway_v1_gateway_proto_depIdxs = nil +} diff --git a/backend/api/config/gateway/v1/gateway.pb.validate.go b/backend/api/config/gateway/v1/gateway.pb.validate.go new file mode 100644 index 0000000000..f35194c6d0 --- /dev/null +++ b/backend/api/config/gateway/v1/gateway.pb.validate.go @@ -0,0 +1,1584 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/gateway/v1/gateway.proto + +package gatewayv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _gateway_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if m.GetGateway() == nil { + return ConfigValidationError{ + field: "Gateway", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetGateway()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Gateway", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetServices() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("Services[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetResolvers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("Resolvers[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetModules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("Modules[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} + +// Validate checks the field values on TCPSocket with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *TCPSocket) Validate() error { + if m == nil { + return nil + } + + if len(m.GetAddress()) < 1 { + return TCPSocketValidationError{ + field: "Address", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetPort() > 65535 { + return TCPSocketValidationError{ + field: "Port", + reason: "value must be less than or equal to 65535", + } + } + + // no validation rules for Secure + + return nil +} + +// TCPSocketValidationError is the validation error returned by +// TCPSocket.Validate if the designated constraints aren't met. +type TCPSocketValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TCPSocketValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TCPSocketValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TCPSocketValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TCPSocketValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TCPSocketValidationError) ErrorName() string { return "TCPSocketValidationError" } + +// Error satisfies the builtin error interface +func (e TCPSocketValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTCPSocket.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TCPSocketValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TCPSocketValidationError{} + +// Validate checks the field values on Listener with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Listener) Validate() error { + if m == nil { + return nil + } + + switch m.Socket.(type) { + + case *Listener_Tcp: + + if v, ok := interface{}(m.GetTcp()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + field: "Tcp", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + return ListenerValidationError{ + field: "Socket", + reason: "value is required", + } + + } + + return nil +} + +// ListenerValidationError is the validation error returned by +// Listener.Validate if the designated constraints aren't met. +type ListenerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListenerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListenerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListenerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListenerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListenerValidationError) ErrorName() string { return "ListenerValidationError" } + +// Error satisfies the builtin error interface +func (e ListenerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListener.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListenerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListenerValidationError{} + +// Validate checks the field values on Stats with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Stats) Validate() error { + if m == nil { + return nil + } + + if d := m.GetFlushInterval(); d != nil { + dur, err := ptypes.Duration(d) + if err != nil { + return StatsValidationError{ + field: "FlushInterval", + reason: "value is not a valid duration", + cause: err, + } + } + + gte := time.Duration(0*time.Second + 100000000*time.Nanosecond) + + if dur < gte { + return StatsValidationError{ + field: "FlushInterval", + reason: "value must be greater than or equal to 100ms", + } + } + + } + + switch m.Reporter.(type) { + + case *Stats_LogReporter_: + + if v, ok := interface{}(m.GetLogReporter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsValidationError{ + field: "LogReporter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Stats_StatsdReporter_: + + if v, ok := interface{}(m.GetStatsdReporter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsValidationError{ + field: "StatsdReporter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// StatsValidationError is the validation error returned by Stats.Validate if +// the designated constraints aren't met. +type StatsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StatsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StatsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StatsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StatsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StatsValidationError) ErrorName() string { return "StatsValidationError" } + +// Error satisfies the builtin error interface +func (e StatsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StatsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StatsValidationError{} + +// Validate checks the field values on Timeouts with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Timeouts) Validate() error { + if m == nil { + return nil + } + + if m.GetDefault() == nil { + return TimeoutsValidationError{ + field: "Default", + reason: "value is required", + } + } + + if d := m.GetDefault(); d != nil { + dur, err := ptypes.Duration(d) + if err != nil { + return TimeoutsValidationError{ + field: "Default", + reason: "value is not a valid duration", + cause: err, + } + } + + gte := time.Duration(1*time.Second + 0*time.Nanosecond) + + if dur < gte { + return TimeoutsValidationError{ + field: "Default", + reason: "value must be greater than or equal to 1s", + } + } + + } + + for idx, item := range m.GetOverrides() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TimeoutsValidationError{ + field: fmt.Sprintf("Overrides[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// TimeoutsValidationError is the validation error returned by +// Timeouts.Validate if the designated constraints aren't met. +type TimeoutsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TimeoutsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TimeoutsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TimeoutsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TimeoutsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TimeoutsValidationError) ErrorName() string { return "TimeoutsValidationError" } + +// Error satisfies the builtin error interface +func (e TimeoutsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTimeouts.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TimeoutsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TimeoutsValidationError{} + +// Validate checks the field values on GatewayOptions with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *GatewayOptions) Validate() error { + if m == nil { + return nil + } + + if m.GetListener() == nil { + return GatewayOptionsValidationError{ + field: "Listener", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetListener()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "Listener", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetJsonGrpcLoopbackListener()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "JsonGrpcLoopbackListener", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetLogger() == nil { + return GatewayOptionsValidationError{ + field: "Logger", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetLogger()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "Logger", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStats() == nil { + return GatewayOptionsValidationError{ + field: "Stats", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetStats()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "Stats", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeouts()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "Timeouts", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetMiddleware() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: fmt.Sprintf("Middleware[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetAssets()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GatewayOptionsValidationError{ + field: "Assets", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// GatewayOptionsValidationError is the validation error returned by +// GatewayOptions.Validate if the designated constraints aren't met. +type GatewayOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GatewayOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GatewayOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GatewayOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GatewayOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GatewayOptionsValidationError) ErrorName() string { return "GatewayOptionsValidationError" } + +// Error satisfies the builtin error interface +func (e GatewayOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGatewayOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GatewayOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GatewayOptionsValidationError{} + +// Validate checks the field values on Assets with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Assets) Validate() error { + if m == nil { + return nil + } + + switch m.Provider.(type) { + + case *Assets_S3: + + if v, ok := interface{}(m.GetS3()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetsValidationError{ + field: "S3", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// AssetsValidationError is the validation error returned by Assets.Validate if +// the designated constraints aren't met. +type AssetsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AssetsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AssetsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AssetsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AssetsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AssetsValidationError) ErrorName() string { return "AssetsValidationError" } + +// Error satisfies the builtin error interface +func (e AssetsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAssets.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AssetsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AssetsValidationError{} + +// Validate checks the field values on Logger with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Logger) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Level + + switch m.Format.(type) { + + case *Logger_Pretty: + // no validation rules for Pretty + + } + + return nil +} + +// LoggerValidationError is the validation error returned by Logger.Validate if +// the designated constraints aren't met. +type LoggerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LoggerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LoggerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LoggerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LoggerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LoggerValidationError) ErrorName() string { return "LoggerValidationError" } + +// Error satisfies the builtin error interface +func (e LoggerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLogger.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LoggerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LoggerValidationError{} + +// Validate checks the field values on Middleware with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Middleware) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return MiddlewareValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MiddlewareValidationError{ + field: "TypedConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// MiddlewareValidationError is the validation error returned by +// Middleware.Validate if the designated constraints aren't met. +type MiddlewareValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MiddlewareValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MiddlewareValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MiddlewareValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MiddlewareValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MiddlewareValidationError) ErrorName() string { return "MiddlewareValidationError" } + +// Error satisfies the builtin error interface +func (e MiddlewareValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMiddleware.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MiddlewareValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MiddlewareValidationError{} + +// Validate checks the field values on Service with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Service) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ServiceValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServiceValidationError{ + field: "TypedConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ServiceValidationError is the validation error returned by Service.Validate +// if the designated constraints aren't met. +type ServiceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ServiceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ServiceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ServiceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ServiceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ServiceValidationError) ErrorName() string { return "ServiceValidationError" } + +// Error satisfies the builtin error interface +func (e ServiceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sService.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ServiceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ServiceValidationError{} + +// Validate checks the field values on Resolver with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Resolver) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ResolverValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResolverValidationError{ + field: "TypedConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ResolverValidationError is the validation error returned by +// Resolver.Validate if the designated constraints aren't met. +type ResolverValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResolverValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResolverValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResolverValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResolverValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResolverValidationError) ErrorName() string { return "ResolverValidationError" } + +// Error satisfies the builtin error interface +func (e ResolverValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResolver.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResolverValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResolverValidationError{} + +// Validate checks the field values on Module with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Module) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ModuleValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ModuleValidationError{ + field: "TypedConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ModuleValidationError is the validation error returned by Module.Validate if +// the designated constraints aren't met. +type ModuleValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ModuleValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ModuleValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ModuleValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ModuleValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ModuleValidationError) ErrorName() string { return "ModuleValidationError" } + +// Error satisfies the builtin error interface +func (e ModuleValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sModule.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ModuleValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ModuleValidationError{} + +// Validate checks the field values on Stats_LogReporter with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *Stats_LogReporter) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// Stats_LogReporterValidationError is the validation error returned by +// Stats_LogReporter.Validate if the designated constraints aren't met. +type Stats_LogReporterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Stats_LogReporterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Stats_LogReporterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Stats_LogReporterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Stats_LogReporterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Stats_LogReporterValidationError) ErrorName() string { + return "Stats_LogReporterValidationError" +} + +// Error satisfies the builtin error interface +func (e Stats_LogReporterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats_LogReporter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Stats_LogReporterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Stats_LogReporterValidationError{} + +// Validate checks the field values on Stats_StatsdReporter with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Stats_StatsdReporter) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Address + + switch m.TagMode.(type) { + + case *Stats_StatsdReporter_PointTags_: + + if v, ok := interface{}(m.GetPointTags()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Stats_StatsdReporterValidationError{ + field: "PointTags", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// Stats_StatsdReporterValidationError is the validation error returned by +// Stats_StatsdReporter.Validate if the designated constraints aren't met. +type Stats_StatsdReporterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Stats_StatsdReporterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Stats_StatsdReporterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Stats_StatsdReporterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Stats_StatsdReporterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Stats_StatsdReporterValidationError) ErrorName() string { + return "Stats_StatsdReporterValidationError" +} + +// Error satisfies the builtin error interface +func (e Stats_StatsdReporterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats_StatsdReporter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Stats_StatsdReporterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Stats_StatsdReporterValidationError{} + +// Validate checks the field values on Stats_StatsdReporter_PointTags with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Stats_StatsdReporter_PointTags) Validate() error { + if m == nil { + return nil + } + + if len(m.GetSeparator()) < 1 { + return Stats_StatsdReporter_PointTagsValidationError{ + field: "Separator", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// Stats_StatsdReporter_PointTagsValidationError is the validation error +// returned by Stats_StatsdReporter_PointTags.Validate if the designated +// constraints aren't met. +type Stats_StatsdReporter_PointTagsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Stats_StatsdReporter_PointTagsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Stats_StatsdReporter_PointTagsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Stats_StatsdReporter_PointTagsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Stats_StatsdReporter_PointTagsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Stats_StatsdReporter_PointTagsValidationError) ErrorName() string { + return "Stats_StatsdReporter_PointTagsValidationError" +} + +// Error satisfies the builtin error interface +func (e Stats_StatsdReporter_PointTagsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats_StatsdReporter_PointTags.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Stats_StatsdReporter_PointTagsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Stats_StatsdReporter_PointTagsValidationError{} + +// Validate checks the field values on Timeouts_Entry with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *Timeouts_Entry) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Service + + // no validation rules for Method + + if m.GetTimeout() == nil { + return Timeouts_EntryValidationError{ + field: "Timeout", + reason: "value is required", + } + } + + if d := m.GetTimeout(); d != nil { + dur, err := ptypes.Duration(d) + if err != nil { + return Timeouts_EntryValidationError{ + field: "Timeout", + reason: "value is not a valid duration", + cause: err, + } + } + + gte := time.Duration(1*time.Second + 0*time.Nanosecond) + + if dur < gte { + return Timeouts_EntryValidationError{ + field: "Timeout", + reason: "value must be greater than or equal to 1s", + } + } + + } + + return nil +} + +// Timeouts_EntryValidationError is the validation error returned by +// Timeouts_Entry.Validate if the designated constraints aren't met. +type Timeouts_EntryValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Timeouts_EntryValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Timeouts_EntryValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Timeouts_EntryValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Timeouts_EntryValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Timeouts_EntryValidationError) ErrorName() string { return "Timeouts_EntryValidationError" } + +// Error satisfies the builtin error interface +func (e Timeouts_EntryValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTimeouts_Entry.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Timeouts_EntryValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Timeouts_EntryValidationError{} + +// Validate checks the field values on Assets_S3Provider with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *Assets_S3Provider) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Region + + // no validation rules for Bucket + + // no validation rules for Key + + return nil +} + +// Assets_S3ProviderValidationError is the validation error returned by +// Assets_S3Provider.Validate if the designated constraints aren't met. +type Assets_S3ProviderValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Assets_S3ProviderValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Assets_S3ProviderValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Assets_S3ProviderValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Assets_S3ProviderValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Assets_S3ProviderValidationError) ErrorName() string { + return "Assets_S3ProviderValidationError" +} + +// Error satisfies the builtin error interface +func (e Assets_S3ProviderValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAssets_S3Provider.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Assets_S3ProviderValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Assets_S3ProviderValidationError{} diff --git a/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.go b/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.go new file mode 100644 index 0000000000..da448201a5 --- /dev/null +++ b/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/module/chaos/experimentation/rtds/v1/rtds.proto + +package rtdsv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + duration "github.com/golang/protobuf/ptypes/duration" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the RTDS layer in Envoy config i.e. envoy.yaml + // https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#config-runtime-rtds + RtdsLayerName string `protobuf:"bytes,1,opt,name=rtds_layer_name,json=rtdsLayerName,proto3" json:"rtds_layer_name,omitempty"` + // Interval in seconds between refreshes of RTDS data from the backing store + CacheRefreshInterval *duration.Duration `protobuf:"bytes,2,opt,name=cache_refresh_interval,json=cacheRefreshInterval,proto3" json:"cache_refresh_interval,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_module_chaos_experimentation_rtds_v1_rtds_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_module_chaos_experimentation_rtds_v1_rtds_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetRtdsLayerName() string { + if x != nil { + return x.RtdsLayerName + } + return "" +} + +func (x *Config) GetCacheRefreshInterval() *duration.Duration { + if x != nil { + return x.CacheRefreshInterval + } + return nil +} + +var File_config_module_chaos_experimentation_rtds_v1_rtds_proto protoreflect.FileDescriptor + +var file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDesc = []byte{ + 0x0a, 0x36, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x63, 0x68, 0x61, 0x6f, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x74, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x74, + 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x32, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x63, + 0x68, 0x61, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x72, 0x74, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x2f, 0x0a, 0x0f, 0x72, 0x74, 0x64, 0x73, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x20, 0x01, 0x52, 0x0d, 0x72, 0x74, 0x64, 0x73, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x4f, 0x0a, 0x16, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x42, 0x08, 0x5a, 0x06, 0x72, 0x74, 0x64, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescOnce sync.Once + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescData = file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDesc +) + +func file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescGZIP() []byte { + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescOnce.Do(func() { + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescData) + }) + return file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDescData +} + +var file_config_module_chaos_experimentation_rtds_v1_rtds_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_config_module_chaos_experimentation_rtds_v1_rtds_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.module.chaos.experimentation.rtds.v1.Config + (*duration.Duration)(nil), // 1: google.protobuf.Duration +} +var file_config_module_chaos_experimentation_rtds_v1_rtds_proto_depIdxs = []int32{ + 1, // 0: clutch.config.module.chaos.experimentation.rtds.v1.Config.cache_refresh_interval:type_name -> google.protobuf.Duration + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_config_module_chaos_experimentation_rtds_v1_rtds_proto_init() } +func file_config_module_chaos_experimentation_rtds_v1_rtds_proto_init() { + if File_config_module_chaos_experimentation_rtds_v1_rtds_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_module_chaos_experimentation_rtds_v1_rtds_proto_goTypes, + DependencyIndexes: file_config_module_chaos_experimentation_rtds_v1_rtds_proto_depIdxs, + MessageInfos: file_config_module_chaos_experimentation_rtds_v1_rtds_proto_msgTypes, + }.Build() + File_config_module_chaos_experimentation_rtds_v1_rtds_proto = out.File + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_rawDesc = nil + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_goTypes = nil + file_config_module_chaos_experimentation_rtds_v1_rtds_proto_depIdxs = nil +} diff --git a/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.validate.go b/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.validate.go new file mode 100644 index 0000000000..1f4e469f95 --- /dev/null +++ b/backend/api/config/module/chaos/experimentation/rtds/v1/rtds.pb.validate.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/module/chaos/experimentation/rtds/v1/rtds.proto + +package rtdsv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _rtds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRtdsLayerName()) < 1 { + return ConfigValidationError{ + field: "RtdsLayerName", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetCacheRefreshInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "CacheRefreshInterval", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/audit/v1/audit.pb.go b/backend/api/config/service/audit/v1/audit.pb.go new file mode 100644 index 0000000000..1c28698fd0 --- /dev/null +++ b/backend/api/config/service/audit/v1/audit.pb.go @@ -0,0 +1,487 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/audit/v1/audit.proto + +package auditv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Switch to control what field the message +type EventFilter_FilterType int32 + +const ( + // Amounts to a no-op filter. + EventFilter_UNSPECIFIED EventFilter_FilterType = 0 + // Compare to the service performing the operation. + EventFilter_SERVICE EventFilter_FilterType = 1 + // Compare to the method being called. + EventFilter_METHOD EventFilter_FilterType = 2 + // Compare against the action type of the event. + EventFilter_TYPE EventFilter_FilterType = 3 +) + +// Enum value maps for EventFilter_FilterType. +var ( + EventFilter_FilterType_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "SERVICE", + 2: "METHOD", + 3: "TYPE", + } + EventFilter_FilterType_value = map[string]int32{ + "UNSPECIFIED": 0, + "SERVICE": 1, + "METHOD": 2, + "TYPE": 3, + } +) + +func (x EventFilter_FilterType) Enum() *EventFilter_FilterType { + p := new(EventFilter_FilterType) + *p = x + return p +} + +func (x EventFilter_FilterType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EventFilter_FilterType) Descriptor() protoreflect.EnumDescriptor { + return file_config_service_audit_v1_audit_proto_enumTypes[0].Descriptor() +} + +func (EventFilter_FilterType) Type() protoreflect.EnumType { + return &file_config_service_audit_v1_audit_proto_enumTypes[0] +} + +func (x EventFilter_FilterType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EventFilter_FilterType.Descriptor instead. +func (EventFilter_FilterType) EnumDescriptor() ([]byte, []int) { + return file_config_service_audit_v1_audit_proto_rawDescGZIP(), []int{0, 0} +} + +type EventFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field EventFilter_FilterType `protobuf:"varint,1,opt,name=field,proto3,enum=clutch.config.service.audit.v1.EventFilter_FilterType" json:"field,omitempty"` + // Types that are assignable to Value: + // *EventFilter_Text + Value isEventFilter_Value `protobuf_oneof:"value"` +} + +func (x *EventFilter) Reset() { + *x = EventFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFilter) ProtoMessage() {} + +func (x *EventFilter) ProtoReflect() protoreflect.Message { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventFilter.ProtoReflect.Descriptor instead. +func (*EventFilter) Descriptor() ([]byte, []int) { + return file_config_service_audit_v1_audit_proto_rawDescGZIP(), []int{0} +} + +func (x *EventFilter) GetField() EventFilter_FilterType { + if x != nil { + return x.Field + } + return EventFilter_UNSPECIFIED +} + +func (m *EventFilter) GetValue() isEventFilter_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *EventFilter) GetText() string { + if x, ok := x.GetValue().(*EventFilter_Text); ok { + return x.Text + } + return "" +} + +type isEventFilter_Value interface { + isEventFilter_Value() +} + +type EventFilter_Text struct { + // Text to compare against the field to look for a match. + Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"` +} + +func (*EventFilter_Text) isEventFilter_Value() {} + +type Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whether to treat the list as a allowlist (default) or a denylist. + Denylist bool `protobuf:"varint,1,opt,name=denylist,proto3" json:"denylist,omitempty"` + // The filter rules to apply against messages. + Rules []*EventFilter `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` +} + +func (x *Filter) Reset() { + *x = Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filter) ProtoMessage() {} + +func (x *Filter) ProtoReflect() protoreflect.Message { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Filter.ProtoReflect.Descriptor instead. +func (*Filter) Descriptor() ([]byte, []int) { + return file_config_service_audit_v1_audit_proto_rawDescGZIP(), []int{1} +} + +func (x *Filter) GetDenylist() bool { + if x != nil { + return x.Denylist + } + return false +} + +func (x *Filter) GetRules() []*EventFilter { + if x != nil { + return x.Rules + } + return nil +} + +type SinkConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The rule(s) to filter events between audit source and sink emission. + Filter *Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *SinkConfig) Reset() { + *x = SinkConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SinkConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SinkConfig) ProtoMessage() {} + +func (x *SinkConfig) ProtoReflect() protoreflect.Message { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SinkConfig.ProtoReflect.Descriptor instead. +func (*SinkConfig) Descriptor() ([]byte, []int) { + return file_config_service_audit_v1_audit_proto_rawDescGZIP(), []int{2} +} + +func (x *SinkConfig) GetFilter() *Filter { + if x != nil { + return x.Filter + } + return nil +} + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the service where the auditor will persist events. + DbProvider string `protobuf:"bytes,1,opt,name=db_provider,json=dbProvider,proto3" json:"db_provider,omitempty"` + // The rule to apply before between request ingress and the database. + Filter *Filter `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + // The registered name of sinks to fan-out events to. + Sinks []string `protobuf:"bytes,3,rep,name=sinks,proto3" json:"sinks,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_audit_v1_audit_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_audit_v1_audit_proto_rawDescGZIP(), []int{3} +} + +func (x *Config) GetDbProvider() string { + if x != nil { + return x.DbProvider + } + return "" +} + +func (x *Config) GetFilter() *Filter { + if x != nil { + return x.Filter + } + return nil +} + +func (x *Config) GetSinks() []string { + if x != nil { + return x.Sinks + } + return nil +} + +var File_config_service_audit_v1_audit_proto protoreflect.FileDescriptor + +var file_config_service_audit_v1_audit_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64, + 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, + 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x4c, + 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x14, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x22, 0x40, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x59, + 0x50, 0x45, 0x10, 0x03, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x67, 0x0a, + 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x79, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x65, 0x6e, 0x79, 0x6c, + 0x69, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, + 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x0a, 0x53, 0x69, 0x6e, 0x6b, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64, + 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x22, 0x88, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x28, 0x0a, 0x0b, 0x64, 0x62, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0a, 0x64, + 0x62, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x69, 0x6e, + 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x6b, 0x73, 0x42, + 0x09, 0x5a, 0x07, 0x61, 0x75, 0x64, 0x69, 0x74, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_config_service_audit_v1_audit_proto_rawDescOnce sync.Once + file_config_service_audit_v1_audit_proto_rawDescData = file_config_service_audit_v1_audit_proto_rawDesc +) + +func file_config_service_audit_v1_audit_proto_rawDescGZIP() []byte { + file_config_service_audit_v1_audit_proto_rawDescOnce.Do(func() { + file_config_service_audit_v1_audit_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_audit_v1_audit_proto_rawDescData) + }) + return file_config_service_audit_v1_audit_proto_rawDescData +} + +var file_config_service_audit_v1_audit_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_config_service_audit_v1_audit_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_config_service_audit_v1_audit_proto_goTypes = []interface{}{ + (EventFilter_FilterType)(0), // 0: clutch.config.service.audit.v1.EventFilter.FilterType + (*EventFilter)(nil), // 1: clutch.config.service.audit.v1.EventFilter + (*Filter)(nil), // 2: clutch.config.service.audit.v1.Filter + (*SinkConfig)(nil), // 3: clutch.config.service.audit.v1.SinkConfig + (*Config)(nil), // 4: clutch.config.service.audit.v1.Config +} +var file_config_service_audit_v1_audit_proto_depIdxs = []int32{ + 0, // 0: clutch.config.service.audit.v1.EventFilter.field:type_name -> clutch.config.service.audit.v1.EventFilter.FilterType + 1, // 1: clutch.config.service.audit.v1.Filter.rules:type_name -> clutch.config.service.audit.v1.EventFilter + 2, // 2: clutch.config.service.audit.v1.SinkConfig.filter:type_name -> clutch.config.service.audit.v1.Filter + 2, // 3: clutch.config.service.audit.v1.Config.filter:type_name -> clutch.config.service.audit.v1.Filter + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_config_service_audit_v1_audit_proto_init() } +func file_config_service_audit_v1_audit_proto_init() { + if File_config_service_audit_v1_audit_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_audit_v1_audit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_audit_v1_audit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_audit_v1_audit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SinkConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_audit_v1_audit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_service_audit_v1_audit_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*EventFilter_Text)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_audit_v1_audit_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_audit_v1_audit_proto_goTypes, + DependencyIndexes: file_config_service_audit_v1_audit_proto_depIdxs, + EnumInfos: file_config_service_audit_v1_audit_proto_enumTypes, + MessageInfos: file_config_service_audit_v1_audit_proto_msgTypes, + }.Build() + File_config_service_audit_v1_audit_proto = out.File + file_config_service_audit_v1_audit_proto_rawDesc = nil + file_config_service_audit_v1_audit_proto_goTypes = nil + file_config_service_audit_v1_audit_proto_depIdxs = nil +} diff --git a/backend/api/config/service/audit/v1/audit.pb.validate.go b/backend/api/config/service/audit/v1/audit.pb.validate.go new file mode 100644 index 0000000000..26c52cbfd3 --- /dev/null +++ b/backend/api/config/service/audit/v1/audit.pb.validate.go @@ -0,0 +1,347 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/audit/v1/audit.proto + +package auditv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _audit_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on EventFilter with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *EventFilter) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Field + + switch m.Value.(type) { + + case *EventFilter_Text: + // no validation rules for Text + + } + + return nil +} + +// EventFilterValidationError is the validation error returned by +// EventFilter.Validate if the designated constraints aren't met. +type EventFilterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EventFilterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EventFilterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EventFilterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EventFilterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EventFilterValidationError) ErrorName() string { return "EventFilterValidationError" } + +// Error satisfies the builtin error interface +func (e EventFilterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sEventFilter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EventFilterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EventFilterValidationError{} + +// Validate checks the field values on Filter with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Filter) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Denylist + + for idx, item := range m.GetRules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterValidationError{ + field: fmt.Sprintf("Rules[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// FilterValidationError is the validation error returned by Filter.Validate if +// the designated constraints aren't met. +type FilterValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FilterValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FilterValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FilterValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FilterValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FilterValidationError) ErrorName() string { return "FilterValidationError" } + +// Error satisfies the builtin error interface +func (e FilterValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFilter.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FilterValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FilterValidationError{} + +// Validate checks the field values on SinkConfig with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *SinkConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SinkConfigValidationError{ + field: "Filter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// SinkConfigValidationError is the validation error returned by +// SinkConfig.Validate if the designated constraints aren't met. +type SinkConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SinkConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SinkConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SinkConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SinkConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SinkConfigValidationError) ErrorName() string { return "SinkConfigValidationError" } + +// Error satisfies the builtin error interface +func (e SinkConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSinkConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SinkConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SinkConfigValidationError{} + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if len(m.GetDbProvider()) < 1 { + return ConfigValidationError{ + field: "DbProvider", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Filter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/auditsink/slack/v1/slack.pb.go b/backend/api/config/service/auditsink/slack/v1/slack.pb.go new file mode 100644 index 0000000000..5b19c22987 --- /dev/null +++ b/backend/api/config/service/auditsink/slack/v1/slack.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/auditsink/slack/v1/slack.proto + +package slackv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + v1 "github.com/lyft/clutch/backend/api/config/service/audit/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type SlackConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` + Filter *v1.Filter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *SlackConfig) Reset() { + *x = SlackConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_auditsink_slack_v1_slack_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SlackConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SlackConfig) ProtoMessage() {} + +func (x *SlackConfig) ProtoReflect() protoreflect.Message { + mi := &file_config_service_auditsink_slack_v1_slack_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SlackConfig.ProtoReflect.Descriptor instead. +func (*SlackConfig) Descriptor() ([]byte, []int) { + return file_config_service_auditsink_slack_v1_slack_proto_rawDescGZIP(), []int{0} +} + +func (x *SlackConfig) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *SlackConfig) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *SlackConfig) GetFilter() *v1.Filter { + if x != nil { + return x.Filter + } + return nil +} + +var File_config_service_auditsink_slack_v1_slack_proto protoreflect.FileDescriptor + +var file_config_service_auditsink_slack_v1_slack_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x73, 0x69, 0x6e, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x63, 0x6b, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x28, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x73, 0x69, 0x6e, 0x6b, + 0x2e, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x0b, 0x53, 0x6c, 0x61, 0x63, + 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, + 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x09, 0x5a, 0x07, 0x73, 0x6c, 0x61, + 0x63, 0x6b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_auditsink_slack_v1_slack_proto_rawDescOnce sync.Once + file_config_service_auditsink_slack_v1_slack_proto_rawDescData = file_config_service_auditsink_slack_v1_slack_proto_rawDesc +) + +func file_config_service_auditsink_slack_v1_slack_proto_rawDescGZIP() []byte { + file_config_service_auditsink_slack_v1_slack_proto_rawDescOnce.Do(func() { + file_config_service_auditsink_slack_v1_slack_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_auditsink_slack_v1_slack_proto_rawDescData) + }) + return file_config_service_auditsink_slack_v1_slack_proto_rawDescData +} + +var file_config_service_auditsink_slack_v1_slack_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_config_service_auditsink_slack_v1_slack_proto_goTypes = []interface{}{ + (*SlackConfig)(nil), // 0: clutch.config.service.auditsink.slack.v1.SlackConfig + (*v1.Filter)(nil), // 1: clutch.config.service.audit.v1.Filter +} +var file_config_service_auditsink_slack_v1_slack_proto_depIdxs = []int32{ + 1, // 0: clutch.config.service.auditsink.slack.v1.SlackConfig.filter:type_name -> clutch.config.service.audit.v1.Filter + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_config_service_auditsink_slack_v1_slack_proto_init() } +func file_config_service_auditsink_slack_v1_slack_proto_init() { + if File_config_service_auditsink_slack_v1_slack_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_auditsink_slack_v1_slack_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SlackConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_auditsink_slack_v1_slack_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_auditsink_slack_v1_slack_proto_goTypes, + DependencyIndexes: file_config_service_auditsink_slack_v1_slack_proto_depIdxs, + MessageInfos: file_config_service_auditsink_slack_v1_slack_proto_msgTypes, + }.Build() + File_config_service_auditsink_slack_v1_slack_proto = out.File + file_config_service_auditsink_slack_v1_slack_proto_rawDesc = nil + file_config_service_auditsink_slack_v1_slack_proto_goTypes = nil + file_config_service_auditsink_slack_v1_slack_proto_depIdxs = nil +} diff --git a/backend/api/config/service/auditsink/slack/v1/slack.pb.validate.go b/backend/api/config/service/auditsink/slack/v1/slack.pb.validate.go new file mode 100644 index 0000000000..812bc41a3d --- /dev/null +++ b/backend/api/config/service/auditsink/slack/v1/slack.pb.validate.go @@ -0,0 +1,126 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/auditsink/slack/v1/slack.proto + +package slackv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _slack_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on SlackConfig with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *SlackConfig) Validate() error { + if m == nil { + return nil + } + + if len(m.GetToken()) < 1 { + return SlackConfigValidationError{ + field: "Token", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetChannel()) < 1 { + return SlackConfigValidationError{ + field: "Channel", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SlackConfigValidationError{ + field: "Filter", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// SlackConfigValidationError is the validation error returned by +// SlackConfig.Validate if the designated constraints aren't met. +type SlackConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SlackConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SlackConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SlackConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SlackConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SlackConfigValidationError) ErrorName() string { return "SlackConfigValidationError" } + +// Error satisfies the builtin error interface +func (e SlackConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSlackConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SlackConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SlackConfigValidationError{} diff --git a/backend/api/config/service/authn/v1/authn.pb.go b/backend/api/config/service/authn/v1/authn.pb.go new file mode 100644 index 0000000000..f61d0ecbab --- /dev/null +++ b/backend/api/config/service/authn/v1/authn.pb.go @@ -0,0 +1,365 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/authn/v1/authn.proto + +package authnv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type OIDC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + RedirectUrl string `protobuf:"bytes,4,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` +} + +func (x *OIDC) Reset() { + *x = OIDC{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OIDC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OIDC) ProtoMessage() {} + +func (x *OIDC) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OIDC.ProtoReflect.Descriptor instead. +func (*OIDC) Descriptor() ([]byte, []int) { + return file_config_service_authn_v1_authn_proto_rawDescGZIP(), []int{0} +} + +func (x *OIDC) GetIssuer() string { + if x != nil { + return x.Issuer + } + return "" +} + +func (x *OIDC) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *OIDC) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *OIDC) GetRedirectUrl() string { + if x != nil { + return x.RedirectUrl + } + return "" +} + +type Storage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Encryption passphrase for credentials stored in the database. + EncryptionPassphrase string `protobuf:"bytes,1,opt,name=encryption_passphrase,json=encryptionPassphrase,proto3" json:"encryption_passphrase,omitempty"` +} + +func (x *Storage) Reset() { + *x = Storage{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Storage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Storage) ProtoMessage() {} + +func (x *Storage) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Storage.ProtoReflect.Descriptor instead. +func (*Storage) Descriptor() ([]byte, []int) { + return file_config_service_authn_v1_authn_proto_rawDescGZIP(), []int{1} +} + +func (x *Storage) GetEncryptionPassphrase() string { + if x != nil { + return x.EncryptionPassphrase + } + return "" +} + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Used to sign the nonce or any other JWT secrets. + SessionSecret string `protobuf:"bytes,1,opt,name=session_secret,json=sessionSecret,proto3" json:"session_secret,omitempty"` + // Types that are assignable to Type: + // *Config_Oidc + Type isConfig_Type `protobuf_oneof:"type"` + // Configure storage of refresh_token from the issuer. Currently optional as storage implementation is in-progress. + // TODO: Update documentation when actual storage is complete, add required message annotation if necessary. + Storage *Storage `protobuf:"bytes,3,opt,name=storage,proto3" json:"storage,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authn_v1_authn_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_authn_v1_authn_proto_rawDescGZIP(), []int{2} +} + +func (x *Config) GetSessionSecret() string { + if x != nil { + return x.SessionSecret + } + return "" +} + +func (m *Config) GetType() isConfig_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *Config) GetOidc() *OIDC { + if x, ok := x.GetType().(*Config_Oidc); ok { + return x.Oidc + } + return nil +} + +func (x *Config) GetStorage() *Storage { + if x != nil { + return x.Storage + } + return nil +} + +type isConfig_Type interface { + isConfig_Type() +} + +type Config_Oidc struct { + Oidc *OIDC `protobuf:"bytes,2,opt,name=oidc,proto3,oneof"` +} + +func (*Config_Oidc) isConfig_Type() {} + +var File_config_service_authn_v1_authn_proto protoreflect.FileDescriptor + +var file_config_service_authn_v1_authn_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, + 0x01, 0x0a, 0x04, 0x4f, 0x49, 0x44, 0x43, 0x12, 0x1f, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, + 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x20, 0x01, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2c, + 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0c, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x0c, + 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0b, 0x72, 0x65, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x22, 0x47, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x15, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x14, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, + 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x0e, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0d, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x3a, 0x0a, 0x04, + 0x6f, 0x69, 0x64, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x49, 0x44, 0x43, + 0x48, 0x00, 0x52, 0x04, 0x6f, 0x69, 0x64, 0x63, 0x12, 0x41, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x42, 0x09, 0x5a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_authn_v1_authn_proto_rawDescOnce sync.Once + file_config_service_authn_v1_authn_proto_rawDescData = file_config_service_authn_v1_authn_proto_rawDesc +) + +func file_config_service_authn_v1_authn_proto_rawDescGZIP() []byte { + file_config_service_authn_v1_authn_proto_rawDescOnce.Do(func() { + file_config_service_authn_v1_authn_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_authn_v1_authn_proto_rawDescData) + }) + return file_config_service_authn_v1_authn_proto_rawDescData +} + +var file_config_service_authn_v1_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_config_service_authn_v1_authn_proto_goTypes = []interface{}{ + (*OIDC)(nil), // 0: clutch.config.service.authn.v1.OIDC + (*Storage)(nil), // 1: clutch.config.service.authn.v1.Storage + (*Config)(nil), // 2: clutch.config.service.authn.v1.Config +} +var file_config_service_authn_v1_authn_proto_depIdxs = []int32{ + 0, // 0: clutch.config.service.authn.v1.Config.oidc:type_name -> clutch.config.service.authn.v1.OIDC + 1, // 1: clutch.config.service.authn.v1.Config.storage:type_name -> clutch.config.service.authn.v1.Storage + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_config_service_authn_v1_authn_proto_init() } +func file_config_service_authn_v1_authn_proto_init() { + if File_config_service_authn_v1_authn_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_authn_v1_authn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OIDC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authn_v1_authn_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Storage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authn_v1_authn_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_service_authn_v1_authn_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Config_Oidc)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_authn_v1_authn_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_authn_v1_authn_proto_goTypes, + DependencyIndexes: file_config_service_authn_v1_authn_proto_depIdxs, + MessageInfos: file_config_service_authn_v1_authn_proto_msgTypes, + }.Build() + File_config_service_authn_v1_authn_proto = out.File + file_config_service_authn_v1_authn_proto_rawDesc = nil + file_config_service_authn_v1_authn_proto_goTypes = nil + file_config_service_authn_v1_authn_proto_depIdxs = nil +} diff --git a/backend/api/config/service/authn/v1/authn.pb.validate.go b/backend/api/config/service/authn/v1/authn.pb.validate.go new file mode 100644 index 0000000000..bbe4c7eadb --- /dev/null +++ b/backend/api/config/service/authn/v1/authn.pb.validate.go @@ -0,0 +1,297 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/authn/v1/authn.proto + +package authnv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _authn_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on OIDC with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *OIDC) Validate() error { + if m == nil { + return nil + } + + if len(m.GetIssuer()) < 1 { + return OIDCValidationError{ + field: "Issuer", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetClientId()) < 1 { + return OIDCValidationError{ + field: "ClientId", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetClientSecret()) < 1 { + return OIDCValidationError{ + field: "ClientSecret", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetRedirectUrl()) < 1 { + return OIDCValidationError{ + field: "RedirectUrl", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// OIDCValidationError is the validation error returned by OIDC.Validate if the +// designated constraints aren't met. +type OIDCValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OIDCValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OIDCValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OIDCValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OIDCValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OIDCValidationError) ErrorName() string { return "OIDCValidationError" } + +// Error satisfies the builtin error interface +func (e OIDCValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOIDC.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OIDCValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OIDCValidationError{} + +// Validate checks the field values on Storage with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Storage) Validate() error { + if m == nil { + return nil + } + + if len(m.GetEncryptionPassphrase()) < 1 { + return StorageValidationError{ + field: "EncryptionPassphrase", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// StorageValidationError is the validation error returned by Storage.Validate +// if the designated constraints aren't met. +type StorageValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StorageValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StorageValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StorageValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StorageValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StorageValidationError) ErrorName() string { return "StorageValidationError" } + +// Error satisfies the builtin error interface +func (e StorageValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStorage.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StorageValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StorageValidationError{} + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if len(m.GetSessionSecret()) < 1 { + return ConfigValidationError{ + field: "SessionSecret", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetStorage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Storage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + switch m.Type.(type) { + + case *Config_Oidc: + + if v, ok := interface{}(m.GetOidc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Oidc", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/authz/v1/authz.pb.go b/backend/api/config/service/authz/v1/authz.pb.go new file mode 100644 index 0000000000..5bb5e02e58 --- /dev/null +++ b/backend/api/config/service/authz/v1/authz.pb.go @@ -0,0 +1,529 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/authz/v1/authz.proto + +package authzv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + v1 "github.com/lyft/clutch/backend/api/api/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Principal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // *Principal_User + // *Principal_Group + Type isPrincipal_Type `protobuf_oneof:"type"` +} + +func (x *Principal) Reset() { + *x = Principal{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Principal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Principal) ProtoMessage() {} + +func (x *Principal) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Principal.ProtoReflect.Descriptor instead. +func (*Principal) Descriptor() ([]byte, []int) { + return file_config_service_authz_v1_authz_proto_rawDescGZIP(), []int{0} +} + +func (m *Principal) GetType() isPrincipal_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *Principal) GetUser() string { + if x, ok := x.GetType().(*Principal_User); ok { + return x.User + } + return "" +} + +func (x *Principal) GetGroup() string { + if x, ok := x.GetType().(*Principal_Group); ok { + return x.Group + } + return "" +} + +type isPrincipal_Type interface { + isPrincipal_Type() +} + +type Principal_User struct { + User string `protobuf:"bytes,1,opt,name=user,proto3,oneof"` +} + +type Principal_Group struct { + Group string `protobuf:"bytes,2,opt,name=group,proto3,oneof"` +} + +func (*Principal_User) isPrincipal_Type() {} + +func (*Principal_Group) isPrincipal_Type() {} + +type RoleBinding struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + To []string `protobuf:"bytes,1,rep,name=to,proto3" json:"to,omitempty"` + Principals []*Principal `protobuf:"bytes,2,rep,name=principals,proto3" json:"principals,omitempty"` +} + +func (x *RoleBinding) Reset() { + *x = RoleBinding{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoleBinding) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleBinding) ProtoMessage() {} + +func (x *RoleBinding) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoleBinding.ProtoReflect.Descriptor instead. +func (*RoleBinding) Descriptor() ([]byte, []int) { + return file_config_service_authz_v1_authz_proto_rawDescGZIP(), []int{1} +} + +func (x *RoleBinding) GetTo() []string { + if x != nil { + return x.To + } + return nil +} + +func (x *RoleBinding) GetPrincipals() []*Principal { + if x != nil { + return x.Principals + } + return nil +} + +type Policy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // For logging purposes, give the policy a defined name. + PolicyName string `protobuf:"bytes,1,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"` + // A list of acceptable action types. If left empty, all action types are accepted. + ActionTypes []v1.ActionType `protobuf:"varint,2,rep,packed,name=action_types,json=actionTypes,proto3,enum=clutch.api.v1.ActionType" json:"action_types,omitempty"` + // The full method in the format of a `/SERVICE/METHOD`. Wildcards are allowed, e.g. `*` or `/SERVICE/*`. + // If left empty, all methods are accepted. + Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + // Resource from the id annotation on proto objects. Wildcards are allowed. + Resources []string `protobuf:"bytes,4,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *Policy) Reset() { + *x = Policy{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Policy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Policy) ProtoMessage() {} + +func (x *Policy) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Policy.ProtoReflect.Descriptor instead. +func (*Policy) Descriptor() ([]byte, []int) { + return file_config_service_authz_v1_authz_proto_rawDescGZIP(), []int{2} +} + +func (x *Policy) GetPolicyName() string { + if x != nil { + return x.PolicyName + } + return "" +} + +func (x *Policy) GetActionTypes() []v1.ActionType { + if x != nil { + return x.ActionTypes + } + return nil +} + +func (x *Policy) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Policy) GetResources() []string { + if x != nil { + return x.Resources + } + return nil +} + +type Role struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoleName string `protobuf:"bytes,1,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` + Policies []*Policy `protobuf:"bytes,2,rep,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *Role) Reset() { + *x = Role{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Role) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Role) ProtoMessage() {} + +func (x *Role) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Role.ProtoReflect.Descriptor instead. +func (*Role) Descriptor() ([]byte, []int) { + return file_config_service_authz_v1_authz_proto_rawDescGZIP(), []int{3} +} + +func (x *Role) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +func (x *Role) GetPolicies() []*Policy { + if x != nil { + return x.Policies + } + return nil +} + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoleBindings []*RoleBinding `protobuf:"bytes,1,rep,name=role_bindings,json=roleBindings,proto3" json:"role_bindings,omitempty"` + Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_authz_v1_authz_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_authz_v1_authz_proto_rawDescGZIP(), []int{4} +} + +func (x *Config) GetRoleBindings() []*RoleBinding { + if x != nil { + return x.RoleBindings + } + return nil +} + +func (x *Config) GetRoles() []*Role { + if x != nil { + return x.Roles + } + return nil +} + +var File_config_service_authz_v1_authz_proto protoreflect.FileDescriptor + +var file_config_service_authz_v1_authz_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x46, 0x0a, 0x09, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x12, 0x14, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x0b, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x89, 0x01, 0x0a, 0x0b, + 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x02, 0x74, + 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x92, 0x01, 0x08, 0x08, + 0x01, 0x22, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x5a, 0x0a, 0x0a, 0x70, + 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x92, + 0x01, 0x09, 0x08, 0x01, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x28, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, + 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0c, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x06, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x70, 0x0a, 0x04, 0x52, 0x6f, 0x6c, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x08, 0x72, + 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x06, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x50, 0x0a, 0x0d, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x72, 0x6f, 0x6c, 0x65, + 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, + 0x6f, 0x6c, 0x65, 0x73, 0x42, 0x09, 0x5a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_authz_v1_authz_proto_rawDescOnce sync.Once + file_config_service_authz_v1_authz_proto_rawDescData = file_config_service_authz_v1_authz_proto_rawDesc +) + +func file_config_service_authz_v1_authz_proto_rawDescGZIP() []byte { + file_config_service_authz_v1_authz_proto_rawDescOnce.Do(func() { + file_config_service_authz_v1_authz_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_authz_v1_authz_proto_rawDescData) + }) + return file_config_service_authz_v1_authz_proto_rawDescData +} + +var file_config_service_authz_v1_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_config_service_authz_v1_authz_proto_goTypes = []interface{}{ + (*Principal)(nil), // 0: clutch.config.service.authz.v1.Principal + (*RoleBinding)(nil), // 1: clutch.config.service.authz.v1.RoleBinding + (*Policy)(nil), // 2: clutch.config.service.authz.v1.Policy + (*Role)(nil), // 3: clutch.config.service.authz.v1.Role + (*Config)(nil), // 4: clutch.config.service.authz.v1.Config + (v1.ActionType)(0), // 5: clutch.api.v1.ActionType +} +var file_config_service_authz_v1_authz_proto_depIdxs = []int32{ + 0, // 0: clutch.config.service.authz.v1.RoleBinding.principals:type_name -> clutch.config.service.authz.v1.Principal + 5, // 1: clutch.config.service.authz.v1.Policy.action_types:type_name -> clutch.api.v1.ActionType + 2, // 2: clutch.config.service.authz.v1.Role.policies:type_name -> clutch.config.service.authz.v1.Policy + 1, // 3: clutch.config.service.authz.v1.Config.role_bindings:type_name -> clutch.config.service.authz.v1.RoleBinding + 3, // 4: clutch.config.service.authz.v1.Config.roles:type_name -> clutch.config.service.authz.v1.Role + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_config_service_authz_v1_authz_proto_init() } +func file_config_service_authz_v1_authz_proto_init() { + if File_config_service_authz_v1_authz_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_authz_v1_authz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Principal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authz_v1_authz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoleBinding); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authz_v1_authz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authz_v1_authz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Role); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_authz_v1_authz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_service_authz_v1_authz_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Principal_User)(nil), + (*Principal_Group)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_authz_v1_authz_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_authz_v1_authz_proto_goTypes, + DependencyIndexes: file_config_service_authz_v1_authz_proto_depIdxs, + MessageInfos: file_config_service_authz_v1_authz_proto_msgTypes, + }.Build() + File_config_service_authz_v1_authz_proto = out.File + file_config_service_authz_v1_authz_proto_rawDesc = nil + file_config_service_authz_v1_authz_proto_goTypes = nil + file_config_service_authz_v1_authz_proto_depIdxs = nil +} diff --git a/backend/api/config/service/authz/v1/authz.pb.validate.go b/backend/api/config/service/authz/v1/authz.pb.validate.go new file mode 100644 index 0000000000..9b52d16fbc --- /dev/null +++ b/backend/api/config/service/authz/v1/authz.pb.validate.go @@ -0,0 +1,488 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/authz/v1/authz.proto + +package authzv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _authz_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Principal with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Principal) Validate() error { + if m == nil { + return nil + } + + switch m.Type.(type) { + + case *Principal_User: + // no validation rules for User + + case *Principal_Group: + // no validation rules for Group + + default: + return PrincipalValidationError{ + field: "Type", + reason: "value is required", + } + + } + + return nil +} + +// PrincipalValidationError is the validation error returned by +// Principal.Validate if the designated constraints aren't met. +type PrincipalValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PrincipalValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PrincipalValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PrincipalValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PrincipalValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PrincipalValidationError) ErrorName() string { return "PrincipalValidationError" } + +// Error satisfies the builtin error interface +func (e PrincipalValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPrincipal.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PrincipalValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PrincipalValidationError{} + +// Validate checks the field values on RoleBinding with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RoleBinding) Validate() error { + if m == nil { + return nil + } + + if len(m.GetTo()) < 1 { + return RoleBindingValidationError{ + field: "To", + reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetTo() { + _, _ = idx, item + + if len(item) < 1 { + return RoleBindingValidationError{ + field: fmt.Sprintf("To[%v]", idx), + reason: "value length must be at least 1 bytes", + } + } + + } + + if len(m.GetPrincipals()) < 1 { + return RoleBindingValidationError{ + field: "Principals", + reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetPrincipals() { + _, _ = idx, item + + if item == nil { + return RoleBindingValidationError{ + field: fmt.Sprintf("Principals[%v]", idx), + reason: "value is required", + } + } + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RoleBindingValidationError{ + field: fmt.Sprintf("Principals[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// RoleBindingValidationError is the validation error returned by +// RoleBinding.Validate if the designated constraints aren't met. +type RoleBindingValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RoleBindingValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RoleBindingValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RoleBindingValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RoleBindingValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RoleBindingValidationError) ErrorName() string { return "RoleBindingValidationError" } + +// Error satisfies the builtin error interface +func (e RoleBindingValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRoleBinding.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RoleBindingValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RoleBindingValidationError{} + +// Validate checks the field values on Policy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Policy) Validate() error { + if m == nil { + return nil + } + + if len(m.GetPolicyName()) < 1 { + return PolicyValidationError{ + field: "PolicyName", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetMethod()) < 1 { + return PolicyValidationError{ + field: "Method", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// PolicyValidationError is the validation error returned by Policy.Validate if +// the designated constraints aren't met. +type PolicyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PolicyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PolicyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PolicyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PolicyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PolicyValidationError) ErrorName() string { return "PolicyValidationError" } + +// Error satisfies the builtin error interface +func (e PolicyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPolicy.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PolicyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PolicyValidationError{} + +// Validate checks the field values on Role with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Role) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRoleName()) < 1 { + return RoleValidationError{ + field: "RoleName", + reason: "value length must be at least 1 bytes", + } + } + + for idx, item := range m.GetPolicies() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RoleValidationError{ + field: fmt.Sprintf("Policies[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// RoleValidationError is the validation error returned by Role.Validate if the +// designated constraints aren't met. +type RoleValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RoleValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RoleValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RoleValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RoleValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RoleValidationError) ErrorName() string { return "RoleValidationError" } + +// Error satisfies the builtin error interface +func (e RoleValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRole.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RoleValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RoleValidationError{} + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRoleBindings() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("RoleBindings[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetRoles() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("Roles[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/aws/v1/aws.pb.go b/backend/api/config/service/aws/v1/aws.pb.go new file mode 100644 index 0000000000..0a32d03016 --- /dev/null +++ b/backend/api/config/service/aws/v1/aws.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/aws/v1/aws.proto + +package awsv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_aws_v1_aws_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_aws_v1_aws_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_aws_v1_aws_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetRegions() []string { + if x != nil { + return x.Regions + } + return nil +} + +var File_config_service_aws_v1_aws_proto protoreflect.FileDescriptor + +var file_config_service_aws_v1_aws_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1c, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x07, 0x5a, 0x05, 0x61, 0x77, 0x73, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_aws_v1_aws_proto_rawDescOnce sync.Once + file_config_service_aws_v1_aws_proto_rawDescData = file_config_service_aws_v1_aws_proto_rawDesc +) + +func file_config_service_aws_v1_aws_proto_rawDescGZIP() []byte { + file_config_service_aws_v1_aws_proto_rawDescOnce.Do(func() { + file_config_service_aws_v1_aws_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_aws_v1_aws_proto_rawDescData) + }) + return file_config_service_aws_v1_aws_proto_rawDescData +} + +var file_config_service_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_config_service_aws_v1_aws_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.service.aws.v1.Config +} +var file_config_service_aws_v1_aws_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_config_service_aws_v1_aws_proto_init() } +func file_config_service_aws_v1_aws_proto_init() { + if File_config_service_aws_v1_aws_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_aws_v1_aws_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_aws_v1_aws_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_aws_v1_aws_proto_goTypes, + DependencyIndexes: file_config_service_aws_v1_aws_proto_depIdxs, + MessageInfos: file_config_service_aws_v1_aws_proto_msgTypes, + }.Build() + File_config_service_aws_v1_aws_proto = out.File + file_config_service_aws_v1_aws_proto_rawDesc = nil + file_config_service_aws_v1_aws_proto_goTypes = nil + file_config_service_aws_v1_aws_proto_depIdxs = nil +} diff --git a/backend/api/config/service/aws/v1/aws.pb.validate.go b/backend/api/config/service/aws/v1/aws.pb.validate.go new file mode 100644 index 0000000000..32ab2c948b --- /dev/null +++ b/backend/api/config/service/aws/v1/aws.pb.validate.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/aws/v1/aws.proto + +package awsv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _aws_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRegions()) < 1 { + return ConfigValidationError{ + field: "Regions", + reason: "value must contain at least 1 item(s)", + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/db/postgres/v1/database.pb.go b/backend/api/config/service/db/postgres/v1/database.pb.go new file mode 100644 index 0000000000..1b1b1a952c --- /dev/null +++ b/backend/api/config/service/db/postgres/v1/database.pb.go @@ -0,0 +1,371 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/db/postgres/v1/database.proto + +package postgresv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Connection_SSLMode int32 + +const ( + Connection_UNSPECIFIED Connection_SSLMode = 0 + Connection_DISABLE Connection_SSLMode = 1 + Connection_ALLOW Connection_SSLMode = 2 + Connection_PREFER Connection_SSLMode = 3 + Connection_REQUIRE Connection_SSLMode = 4 + Connection_VERIFY_CA Connection_SSLMode = 5 + Connection_VERIFY_FULL Connection_SSLMode = 6 +) + +// Enum value maps for Connection_SSLMode. +var ( + Connection_SSLMode_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "DISABLE", + 2: "ALLOW", + 3: "PREFER", + 4: "REQUIRE", + 5: "VERIFY_CA", + 6: "VERIFY_FULL", + } + Connection_SSLMode_value = map[string]int32{ + "UNSPECIFIED": 0, + "DISABLE": 1, + "ALLOW": 2, + "PREFER": 3, + "REQUIRE": 4, + "VERIFY_CA": 5, + "VERIFY_FULL": 6, + } +) + +func (x Connection_SSLMode) Enum() *Connection_SSLMode { + p := new(Connection_SSLMode) + *p = x + return p +} + +func (x Connection_SSLMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Connection_SSLMode) Descriptor() protoreflect.EnumDescriptor { + return file_config_service_db_postgres_v1_database_proto_enumTypes[0].Descriptor() +} + +func (Connection_SSLMode) Type() protoreflect.EnumType { + return &file_config_service_db_postgres_v1_database_proto_enumTypes[0] +} + +func (x Connection_SSLMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Connection_SSLMode.Descriptor instead. +func (Connection_SSLMode) EnumDescriptor() ([]byte, []int) { + return file_config_service_db_postgres_v1_database_proto_rawDescGZIP(), []int{0, 0} +} + +type Connection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` + Dbname string `protobuf:"bytes,4,opt,name=dbname,proto3" json:"dbname,omitempty"` + SslMode Connection_SSLMode `protobuf:"varint,5,opt,name=ssl_mode,json=sslMode,proto3,enum=clutch.config.service.db.postgres.v1.Connection_SSLMode" json:"ssl_mode,omitempty"` + // TODO: GSSAPI, SSPI, Kerberos + // + // Types that are assignable to Authn: + // *Connection_Password + Authn isConnection_Authn `protobuf_oneof:"authn"` +} + +func (x *Connection) Reset() { + *x = Connection{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_db_postgres_v1_database_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Connection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Connection) ProtoMessage() {} + +func (x *Connection) ProtoReflect() protoreflect.Message { + mi := &file_config_service_db_postgres_v1_database_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Connection.ProtoReflect.Descriptor instead. +func (*Connection) Descriptor() ([]byte, []int) { + return file_config_service_db_postgres_v1_database_proto_rawDescGZIP(), []int{0} +} + +func (x *Connection) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Connection) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Connection) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *Connection) GetDbname() string { + if x != nil { + return x.Dbname + } + return "" +} + +func (x *Connection) GetSslMode() Connection_SSLMode { + if x != nil { + return x.SslMode + } + return Connection_UNSPECIFIED +} + +func (m *Connection) GetAuthn() isConnection_Authn { + if m != nil { + return m.Authn + } + return nil +} + +func (x *Connection) GetPassword() string { + if x, ok := x.GetAuthn().(*Connection_Password); ok { + return x.Password + } + return "" +} + +type isConnection_Authn interface { + isConnection_Authn() +} + +type Connection_Password struct { + Password string `protobuf:"bytes,6,opt,name=password,proto3,oneof"` +} + +func (*Connection_Password) isConnection_Authn() {} + +// TODO: Expose more database/sql tunables. +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_db_postgres_v1_database_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_db_postgres_v1_database_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_db_postgres_v1_database_proto_rawDescGZIP(), []int{1} +} + +func (x *Config) GetConnection() *Connection { + if x != nil { + return x.Connection + } + return nil +} + +var File_config_service_db_postgres_v1_database_proto protoreflect.FileDescriptor + +var file_config_service_db_postgres_v1_database_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x64, 0x62, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x02, + 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, + 0x03, 0xa8, 0x01, 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x18, + 0xff, 0xff, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, + 0x0a, 0x08, 0x73, 0x73, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x38, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x6f, 0x73, 0x74, + 0x67, 0x72, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x53, 0x53, 0x4c, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x73, 0x73, 0x6c, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x6b, 0x0a, 0x07, 0x53, 0x53, + 0x4c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, + 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x45, 0x52, 0x49, 0x46, + 0x59, 0x5f, 0x43, 0x41, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, + 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x06, 0x42, 0x07, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, + 0x22, 0x5a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x50, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x5a, 0x0a, + 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_config_service_db_postgres_v1_database_proto_rawDescOnce sync.Once + file_config_service_db_postgres_v1_database_proto_rawDescData = file_config_service_db_postgres_v1_database_proto_rawDesc +) + +func file_config_service_db_postgres_v1_database_proto_rawDescGZIP() []byte { + file_config_service_db_postgres_v1_database_proto_rawDescOnce.Do(func() { + file_config_service_db_postgres_v1_database_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_db_postgres_v1_database_proto_rawDescData) + }) + return file_config_service_db_postgres_v1_database_proto_rawDescData +} + +var file_config_service_db_postgres_v1_database_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_config_service_db_postgres_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_config_service_db_postgres_v1_database_proto_goTypes = []interface{}{ + (Connection_SSLMode)(0), // 0: clutch.config.service.db.postgres.v1.Connection.SSLMode + (*Connection)(nil), // 1: clutch.config.service.db.postgres.v1.Connection + (*Config)(nil), // 2: clutch.config.service.db.postgres.v1.Config +} +var file_config_service_db_postgres_v1_database_proto_depIdxs = []int32{ + 0, // 0: clutch.config.service.db.postgres.v1.Connection.ssl_mode:type_name -> clutch.config.service.db.postgres.v1.Connection.SSLMode + 1, // 1: clutch.config.service.db.postgres.v1.Config.connection:type_name -> clutch.config.service.db.postgres.v1.Connection + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_config_service_db_postgres_v1_database_proto_init() } +func file_config_service_db_postgres_v1_database_proto_init() { + if File_config_service_db_postgres_v1_database_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_db_postgres_v1_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Connection); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_db_postgres_v1_database_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_service_db_postgres_v1_database_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Connection_Password)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_db_postgres_v1_database_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_db_postgres_v1_database_proto_goTypes, + DependencyIndexes: file_config_service_db_postgres_v1_database_proto_depIdxs, + EnumInfos: file_config_service_db_postgres_v1_database_proto_enumTypes, + MessageInfos: file_config_service_db_postgres_v1_database_proto_msgTypes, + }.Build() + File_config_service_db_postgres_v1_database_proto = out.File + file_config_service_db_postgres_v1_database_proto_rawDesc = nil + file_config_service_db_postgres_v1_database_proto_goTypes = nil + file_config_service_db_postgres_v1_database_proto_depIdxs = nil +} diff --git a/backend/api/config/service/db/postgres/v1/database.pb.validate.go b/backend/api/config/service/db/postgres/v1/database.pb.validate.go new file mode 100644 index 0000000000..949a85378d --- /dev/null +++ b/backend/api/config/service/db/postgres/v1/database.pb.validate.go @@ -0,0 +1,245 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/db/postgres/v1/database.proto + +package postgresv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _database_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Connection with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Connection) Validate() error { + if m == nil { + return nil + } + + if err := m._validateHostname(m.GetHost()); err != nil { + if ip := net.ParseIP(m.GetHost()); ip == nil { + return ConnectionValidationError{ + field: "Host", + reason: "value must be a valid hostname, or ip address", + } + } + } + + if m.GetPort() > 65535 { + return ConnectionValidationError{ + field: "Port", + reason: "value must be less than or equal to 65535", + } + } + + if utf8.RuneCountInString(m.GetUser()) < 1 { + return ConnectionValidationError{ + field: "User", + reason: "value length must be at least 1 runes", + } + } + + // no validation rules for Dbname + + // no validation rules for SslMode + + switch m.Authn.(type) { + + case *Connection_Password: + + if utf8.RuneCountInString(m.GetPassword()) < 1 { + return ConnectionValidationError{ + field: "Password", + reason: "value length must be at least 1 runes", + } + } + + } + + return nil +} + +func (m *Connection) _validateHostname(host string) error { + s := strings.ToLower(strings.TrimSuffix(host, ".")) + + if len(host) > 253 { + return errors.New("hostname cannot exceed 253 characters") + } + + for _, part := range strings.Split(s, ".") { + if l := len(part); l == 0 || l > 63 { + return errors.New("hostname part must be non-empty and cannot exceed 63 characters") + } + + if part[0] == '-' { + return errors.New("hostname parts cannot begin with hyphens") + } + + if part[len(part)-1] == '-' { + return errors.New("hostname parts cannot end with hyphens") + } + + for _, r := range part { + if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { + return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) + } + } + } + + return nil +} + +// ConnectionValidationError is the validation error returned by +// Connection.Validate if the designated constraints aren't met. +type ConnectionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConnectionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConnectionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConnectionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConnectionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConnectionValidationError) ErrorName() string { return "ConnectionValidationError" } + +// Error satisfies the builtin error interface +func (e ConnectionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConnection.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConnectionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConnectionValidationError{} + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetConnection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Connection", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.go b/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.go new file mode 100644 index 0000000000..6e009e9df7 --- /dev/null +++ b/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.go @@ -0,0 +1,166 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/envoyadmin/v1/envoyadmin.proto + +package envoyadminv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Secure bool `protobuf:"varint,1,opt,name=secure,proto3" json:"secure,omitempty"` + // port value used for a remote host when one isn't specified + DefaultRemotePort uint32 `protobuf:"varint,2,opt,name=default_remote_port,json=defaultRemotePort,proto3" json:"default_remote_port,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_envoyadmin_v1_envoyadmin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_envoyadmin_v1_envoyadmin_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetSecure() bool { + if x != nil { + return x.Secure + } + return false +} + +func (x *Config) GetDefaultRemotePort() uint32 { + if x != nil { + return x.DefaultRemotePort + } + return 0 +} + +var File_config_service_envoyadmin_v1_envoyadmin_proto protoreflect.FileDescriptor + +var file_config_service_envoyadmin_v1_envoyadmin_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x23, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x6a, 0x02, 0x08, 0x00, + 0x52, 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x13, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x18, 0xff, 0xff, 0x03, + 0x52, 0x11, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, + 0x6f, 0x72, 0x74, 0x42, 0x0e, 0x5a, 0x0c, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescOnce sync.Once + file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescData = file_config_service_envoyadmin_v1_envoyadmin_proto_rawDesc +) + +func file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescGZIP() []byte { + file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescOnce.Do(func() { + file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescData) + }) + return file_config_service_envoyadmin_v1_envoyadmin_proto_rawDescData +} + +var file_config_service_envoyadmin_v1_envoyadmin_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_config_service_envoyadmin_v1_envoyadmin_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.service.envoyadmin.v1.Config +} +var file_config_service_envoyadmin_v1_envoyadmin_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_config_service_envoyadmin_v1_envoyadmin_proto_init() } +func file_config_service_envoyadmin_v1_envoyadmin_proto_init() { + if File_config_service_envoyadmin_v1_envoyadmin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_envoyadmin_v1_envoyadmin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_envoyadmin_v1_envoyadmin_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_envoyadmin_v1_envoyadmin_proto_goTypes, + DependencyIndexes: file_config_service_envoyadmin_v1_envoyadmin_proto_depIdxs, + MessageInfos: file_config_service_envoyadmin_v1_envoyadmin_proto_msgTypes, + }.Build() + File_config_service_envoyadmin_v1_envoyadmin_proto = out.File + file_config_service_envoyadmin_v1_envoyadmin_proto_rawDesc = nil + file_config_service_envoyadmin_v1_envoyadmin_proto_goTypes = nil + file_config_service_envoyadmin_v1_envoyadmin_proto_depIdxs = nil +} diff --git a/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.validate.go b/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.validate.go new file mode 100644 index 0000000000..676039bf44 --- /dev/null +++ b/backend/api/config/service/envoyadmin/v1/envoyadmin.pb.validate.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/envoyadmin/v1/envoyadmin.proto + +package envoyadminv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _envoyadmin_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if m.GetSecure() != false { + return ConfigValidationError{ + field: "Secure", + reason: "value must equal false", + } + } + + if m.GetDefaultRemotePort() > 65535 { + return ConfigValidationError{ + field: "DefaultRemotePort", + reason: "value must be less than or equal to 65535", + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/github/v1/github.pb.go b/backend/api/config/service/github/v1/github.pb.go new file mode 100644 index 0000000000..4adde410a5 --- /dev/null +++ b/backend/api/config/service/github/v1/github.pb.go @@ -0,0 +1,176 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/github/v1/github.proto + +package githubv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Auth: + // *Config_AccessToken + Auth isConfig_Auth `protobuf_oneof:"auth"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_github_v1_github_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_github_v1_github_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_github_v1_github_proto_rawDescGZIP(), []int{0} +} + +func (m *Config) GetAuth() isConfig_Auth { + if m != nil { + return m.Auth + } + return nil +} + +func (x *Config) GetAccessToken() string { + if x, ok := x.GetAuth().(*Config_AccessToken); ok { + return x.AccessToken + } + return "" +} + +type isConfig_Auth interface { + isConfig_Auth() +} + +type Config_AccessToken struct { + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3,oneof"` +} + +func (*Config_AccessToken) isConfig_Auth() {} + +var File_config_service_github_v1_github_proto protoreflect.FileDescriptor + +var file_config_service_github_v1_github_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x43, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x0c, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0b, 0x0a, 0x04, 0x61, 0x75, 0x74, + 0x68, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_github_v1_github_proto_rawDescOnce sync.Once + file_config_service_github_v1_github_proto_rawDescData = file_config_service_github_v1_github_proto_rawDesc +) + +func file_config_service_github_v1_github_proto_rawDescGZIP() []byte { + file_config_service_github_v1_github_proto_rawDescOnce.Do(func() { + file_config_service_github_v1_github_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_github_v1_github_proto_rawDescData) + }) + return file_config_service_github_v1_github_proto_rawDescData +} + +var file_config_service_github_v1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_config_service_github_v1_github_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.service.github.v1.Config +} +var file_config_service_github_v1_github_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_config_service_github_v1_github_proto_init() } +func file_config_service_github_v1_github_proto_init() { + if File_config_service_github_v1_github_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_github_v1_github_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_config_service_github_v1_github_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Config_AccessToken)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_github_v1_github_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_github_v1_github_proto_goTypes, + DependencyIndexes: file_config_service_github_v1_github_proto_depIdxs, + MessageInfos: file_config_service_github_v1_github_proto_msgTypes, + }.Build() + File_config_service_github_v1_github_proto = out.File + file_config_service_github_v1_github_proto_rawDesc = nil + file_config_service_github_v1_github_proto_goTypes = nil + file_config_service_github_v1_github_proto_depIdxs = nil +} diff --git a/backend/api/config/service/github/v1/github.pb.validate.go b/backend/api/config/service/github/v1/github.pb.validate.go new file mode 100644 index 0000000000..666f34c252 --- /dev/null +++ b/backend/api/config/service/github/v1/github.pb.validate.go @@ -0,0 +1,120 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/github/v1/github.proto + +package githubv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _github_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + switch m.Auth.(type) { + + case *Config_AccessToken: + + if len(m.GetAccessToken()) < 1 { + return ConfigValidationError{ + field: "AccessToken", + reason: "value length must be at least 1 bytes", + } + } + + default: + return ConfigValidationError{ + field: "Auth", + reason: "value is required", + } + + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} diff --git a/backend/api/config/service/k8s/v1/k8s.pb.go b/backend/api/config/service/k8s/v1/k8s.pb.go new file mode 100644 index 0000000000..7ab57903a9 --- /dev/null +++ b/backend/api/config/service/k8s/v1/k8s.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/k8s/v1/k8s.proto + +package k8sv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + duration "github.com/golang/protobuf/ptypes/duration" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kubeconfigs []string `protobuf:"bytes,1,rep,name=kubeconfigs,proto3" json:"kubeconfigs,omitempty"` + RestClientConfig *RestClientConfig `protobuf:"bytes,2,opt,name=rest_client_config,json=restClientConfig,proto3" json:"rest_client_config,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_k8s_v1_k8s_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_k8s_v1_k8s_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_k8s_v1_k8s_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetKubeconfigs() []string { + if x != nil { + return x.Kubeconfigs + } + return nil +} + +func (x *Config) GetRestClientConfig() *RestClientConfig { + if x != nil { + return x.RestClientConfig + } + return nil +} + +// These configuration values are passed directly through to the rest config object. +type RestClientConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The maximum length of time to wait before giving up on a server request. + // By default a value of zero means no timeout. + // https://github.com/kubernetes/client-go/blob/00dbcca6ee44c678754d3f5fda1bd0e704b26fe2/rest/config.go#L130-L131 + Timeout *duration.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + // QPS indicates the maximum QPS to the master from this client. + // If it's zero, the created RESTClient will use DefaultQPS: 5 + // https://github.com/kubernetes/client-go/blob/00dbcca6ee44c678754d3f5fda1bd0e704b26fe2/rest/config.go#L115-L117 + Qps float32 `protobuf:"fixed32,2,opt,name=qps,proto3" json:"qps,omitempty"` + // Maximum burst for throttle. + // If it's zero, the created RESTClient will use DefaultBurst: 10. + // https://github.com/kubernetes/client-go/blob/00dbcca6ee44c678754d3f5fda1bd0e704b26fe2/rest/config.go#L119-L121 + Burst uint32 `protobuf:"varint,3,opt,name=burst,proto3" json:"burst,omitempty"` +} + +func (x *RestClientConfig) Reset() { + *x = RestClientConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_k8s_v1_k8s_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RestClientConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestClientConfig) ProtoMessage() {} + +func (x *RestClientConfig) ProtoReflect() protoreflect.Message { + mi := &file_config_service_k8s_v1_k8s_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RestClientConfig.ProtoReflect.Descriptor instead. +func (*RestClientConfig) Descriptor() ([]byte, []int) { + return file_config_service_k8s_v1_k8s_proto_rawDescGZIP(), []int{1} +} + +func (x *RestClientConfig) GetTimeout() *duration.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *RestClientConfig) GetQps() float32 { + if x != nil { + return x.Qps + } + return 0 +} + +func (x *RestClientConfig) GetBurst() uint32 { + if x != nil { + return x.Burst + } + return 0 +} + +var File_config_service_k8s_v1_k8s_proto protoreflect.FileDescriptor + +var file_config_service_k8s_v1_k8s_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1c, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, + 0x18, 0x01, 0x52, 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, + 0x5c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x72, 0x65, 0x73, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x90, 0x01, + 0x0a, 0x10, 0x52, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0xaa, 0x01, 0x04, 0x32, 0x02, 0x08, 0x00, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x03, 0x71, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x71, 0x70, + 0x73, 0x12, 0x1d, 0x0a, 0x05, 0x62, 0x75, 0x72, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x05, 0x62, 0x75, 0x72, 0x73, 0x74, + 0x42, 0x07, 0x5a, 0x05, 0x6b, 0x38, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_config_service_k8s_v1_k8s_proto_rawDescOnce sync.Once + file_config_service_k8s_v1_k8s_proto_rawDescData = file_config_service_k8s_v1_k8s_proto_rawDesc +) + +func file_config_service_k8s_v1_k8s_proto_rawDescGZIP() []byte { + file_config_service_k8s_v1_k8s_proto_rawDescOnce.Do(func() { + file_config_service_k8s_v1_k8s_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_k8s_v1_k8s_proto_rawDescData) + }) + return file_config_service_k8s_v1_k8s_proto_rawDescData +} + +var file_config_service_k8s_v1_k8s_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_config_service_k8s_v1_k8s_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.service.k8s.v1.Config + (*RestClientConfig)(nil), // 1: clutch.config.service.k8s.v1.RestClientConfig + (*duration.Duration)(nil), // 2: google.protobuf.Duration +} +var file_config_service_k8s_v1_k8s_proto_depIdxs = []int32{ + 1, // 0: clutch.config.service.k8s.v1.Config.rest_client_config:type_name -> clutch.config.service.k8s.v1.RestClientConfig + 2, // 1: clutch.config.service.k8s.v1.RestClientConfig.timeout:type_name -> google.protobuf.Duration + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_config_service_k8s_v1_k8s_proto_init() } +func file_config_service_k8s_v1_k8s_proto_init() { + if File_config_service_k8s_v1_k8s_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_k8s_v1_k8s_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_k8s_v1_k8s_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RestClientConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_k8s_v1_k8s_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_k8s_v1_k8s_proto_goTypes, + DependencyIndexes: file_config_service_k8s_v1_k8s_proto_depIdxs, + MessageInfos: file_config_service_k8s_v1_k8s_proto_msgTypes, + }.Build() + File_config_service_k8s_v1_k8s_proto = out.File + file_config_service_k8s_v1_k8s_proto_rawDesc = nil + file_config_service_k8s_v1_k8s_proto_goTypes = nil + file_config_service_k8s_v1_k8s_proto_depIdxs = nil +} diff --git a/backend/api/config/service/k8s/v1/k8s.pb.validate.go b/backend/api/config/service/k8s/v1/k8s.pb.validate.go new file mode 100644 index 0000000000..b8e9de6cdc --- /dev/null +++ b/backend/api/config/service/k8s/v1/k8s.pb.validate.go @@ -0,0 +1,228 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/k8s/v1/k8s.proto + +package k8sv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _k_8_s_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + _Config_Kubeconfigs_Unique := make(map[string]struct{}, len(m.GetKubeconfigs())) + + for idx, item := range m.GetKubeconfigs() { + _, _ = idx, item + + if _, exists := _Config_Kubeconfigs_Unique[item]; exists { + return ConfigValidationError{ + field: fmt.Sprintf("Kubeconfigs[%v]", idx), + reason: "repeated value must contain unique items", + } + } else { + _Config_Kubeconfigs_Unique[item] = struct{}{} + } + + // no validation rules for Kubeconfigs[idx] + } + + if v, ok := interface{}(m.GetRestClientConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "RestClientConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} + +// Validate checks the field values on RestClientConfig with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *RestClientConfig) Validate() error { + if m == nil { + return nil + } + + if d := m.GetTimeout(); d != nil { + dur, err := ptypes.Duration(d) + if err != nil { + return RestClientConfigValidationError{ + field: "Timeout", + reason: "value is not a valid duration", + cause: err, + } + } + + gte := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur < gte { + return RestClientConfigValidationError{ + field: "Timeout", + reason: "value must be greater than or equal to 0s", + } + } + + } + + if m.GetQps() < 0 { + return RestClientConfigValidationError{ + field: "Qps", + reason: "value must be greater than or equal to 0", + } + } + + if m.GetBurst() < 0 { + return RestClientConfigValidationError{ + field: "Burst", + reason: "value must be greater than or equal to 0", + } + } + + return nil +} + +// RestClientConfigValidationError is the validation error returned by +// RestClientConfig.Validate if the designated constraints aren't met. +type RestClientConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RestClientConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RestClientConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RestClientConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RestClientConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RestClientConfigValidationError) ErrorName() string { return "RestClientConfigValidationError" } + +// Error satisfies the builtin error interface +func (e RestClientConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRestClientConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RestClientConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RestClientConfigValidationError{} diff --git a/backend/api/config/service/topology/v1/topology.pb.go b/backend/api/config/service/topology/v1/topology.pb.go new file mode 100644 index 0000000000..99f35065bc --- /dev/null +++ b/backend/api/config/service/topology/v1/topology.pb.go @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config/service/topology/v1/topology.proto + +package topologyv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + duration "github.com/golang/protobuf/ptypes/duration" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cache *Cache `protobuf:"bytes,1,opt,name=cache,proto3" json:"cache,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_topology_v1_topology_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_config_service_topology_v1_topology_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_config_service_topology_v1_topology_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetCache() *Cache { + if x != nil { + return x.Cache + } + return nil +} + +type Cache struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The time to live (ttl) for an item in cache, the default is 1 hour (3600 seconds). + Ttl *duration.Duration `protobuf:"bytes,1,opt,name=ttl,proto3" json:"ttl,omitempty"` +} + +func (x *Cache) Reset() { + *x = Cache{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_topology_v1_topology_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cache) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cache) ProtoMessage() {} + +func (x *Cache) ProtoReflect() protoreflect.Message { + mi := &file_config_service_topology_v1_topology_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cache.ProtoReflect.Descriptor instead. +func (*Cache) Descriptor() ([]byte, []int) { + return file_config_service_topology_v1_topology_proto_rawDescGZIP(), []int{1} +} + +func (x *Cache) GetTtl() *duration.Duration { + if x != nil { + return x.Ttl + } + return nil +} + +var File_config_service_topology_v1_topology_proto protoreflect.FileDescriptor + +var file_config_service_topology_v1_topology_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x70, + 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x76, 0x31, 0x1a, 0x17, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x3e, 0x0a, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x05, 0x63, 0x61, 0x63, 0x68, + 0x65, 0x22, 0x40, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x74, 0x74, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0xaa, 0x01, 0x04, 0x2a, 0x02, 0x08, 0x01, 0x52, 0x03, + 0x74, 0x74, 0x6c, 0x42, 0x0c, 0x5a, 0x0a, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_config_service_topology_v1_topology_proto_rawDescOnce sync.Once + file_config_service_topology_v1_topology_proto_rawDescData = file_config_service_topology_v1_topology_proto_rawDesc +) + +func file_config_service_topology_v1_topology_proto_rawDescGZIP() []byte { + file_config_service_topology_v1_topology_proto_rawDescOnce.Do(func() { + file_config_service_topology_v1_topology_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_service_topology_v1_topology_proto_rawDescData) + }) + return file_config_service_topology_v1_topology_proto_rawDescData +} + +var file_config_service_topology_v1_topology_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_config_service_topology_v1_topology_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: clutch.config.service.topology.v1.Config + (*Cache)(nil), // 1: clutch.config.service.topology.v1.Cache + (*duration.Duration)(nil), // 2: google.protobuf.Duration +} +var file_config_service_topology_v1_topology_proto_depIdxs = []int32{ + 1, // 0: clutch.config.service.topology.v1.Config.cache:type_name -> clutch.config.service.topology.v1.Cache + 2, // 1: clutch.config.service.topology.v1.Cache.ttl:type_name -> google.protobuf.Duration + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_config_service_topology_v1_topology_proto_init() } +func file_config_service_topology_v1_topology_proto_init() { + if File_config_service_topology_v1_topology_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_config_service_topology_v1_topology_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_config_service_topology_v1_topology_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cache); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_config_service_topology_v1_topology_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_config_service_topology_v1_topology_proto_goTypes, + DependencyIndexes: file_config_service_topology_v1_topology_proto_depIdxs, + MessageInfos: file_config_service_topology_v1_topology_proto_msgTypes, + }.Build() + File_config_service_topology_v1_topology_proto = out.File + file_config_service_topology_v1_topology_proto_rawDesc = nil + file_config_service_topology_v1_topology_proto_goTypes = nil + file_config_service_topology_v1_topology_proto_depIdxs = nil +} diff --git a/backend/api/config/service/topology/v1/topology.pb.validate.go b/backend/api/config/service/topology/v1/topology.pb.validate.go new file mode 100644 index 0000000000..30911a0182 --- /dev/null +++ b/backend/api/config/service/topology/v1/topology.pb.validate.go @@ -0,0 +1,196 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: config/service/topology/v1/topology.proto + +package topologyv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _topology_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Config) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCache()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: "Cache", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigValidationError is the validation error returned by Config.Validate if +// the designated constraints aren't met. +type ConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigValidationError{} + +// Validate checks the field values on Cache with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Cache) Validate() error { + if m == nil { + return nil + } + + if d := m.GetTtl(); d != nil { + dur, err := ptypes.Duration(d) + if err != nil { + return CacheValidationError{ + field: "Ttl", + reason: "value is not a valid duration", + cause: err, + } + } + + gt := time.Duration(1*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return CacheValidationError{ + field: "Ttl", + reason: "value must be greater than 1s", + } + } + + } + + return nil +} + +// CacheValidationError is the validation error returned by Cache.Validate if +// the designated constraints aren't met. +type CacheValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CacheValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CacheValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CacheValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CacheValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CacheValidationError) ErrorName() string { return "CacheValidationError" } + +// Error satisfies the builtin error interface +func (e CacheValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCache.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CacheValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CacheValidationError{} diff --git a/backend/api/envoytriage/v1/envoytriage_api.pb.go b/backend/api/envoytriage/v1/envoytriage_api.pb.go new file mode 100644 index 0000000000..b11dad766a --- /dev/null +++ b/backend/api/envoytriage/v1/envoytriage_api.pb.go @@ -0,0 +1,909 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: envoytriage/v1/envoytriage_api.proto + +package envoytriagev1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ReadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Operations []*ReadOperation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` +} + +func (x *ReadRequest) Reset() { + *x = ReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadRequest) ProtoMessage() {} + +func (x *ReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. +func (*ReadRequest) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{0} +} + +func (x *ReadRequest) GetOperations() []*ReadOperation { + if x != nil { + return x.Operations + } + return nil +} + +type ReadOperation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Include *ReadOperation_Include `protobuf:"bytes,2,opt,name=include,proto3" json:"include,omitempty"` +} + +func (x *ReadOperation) Reset() { + *x = ReadOperation{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadOperation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadOperation) ProtoMessage() {} + +func (x *ReadOperation) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadOperation.ProtoReflect.Descriptor instead. +func (*ReadOperation) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{1} +} + +func (x *ReadOperation) GetAddress() *Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *ReadOperation) GetInclude() *ReadOperation_Include { + if x != nil { + return x.Include + } + return nil +} + +type ReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *ReadResponse) Reset() { + *x = ReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResponse) ProtoMessage() {} + +func (x *ReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. +func (*ReadResponse) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{2} +} + +func (x *ReadResponse) GetResults() []*Result { + if x != nil { + return x.Results + } + return nil +} + +type Address struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Address) Reset() { + *x = Address{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Address) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Address) ProtoMessage() {} + +func (x *Address) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Address.ProtoReflect.Descriptor instead. +func (*Address) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{3} +} + +func (x *Address) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Address) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +type Result struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + NodeMetadata *NodeMetadata `protobuf:"bytes,2,opt,name=node_metadata,json=nodeMetadata,proto3" json:"node_metadata,omitempty"` + Output *Result_Output `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` +} + +func (x *Result) Reset() { + *x = Result{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Result) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Result) ProtoMessage() {} + +func (x *Result) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Result.ProtoReflect.Descriptor instead. +func (*Result) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{4} +} + +func (x *Result) GetAddress() *Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *Result) GetNodeMetadata() *NodeMetadata { + if x != nil { + return x.NodeMetadata + } + return nil +} + +func (x *Result) GetOutput() *Result_Output { + if x != nil { + return x.Output + } + return nil +} + +type NodeMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceNode string `protobuf:"bytes,1,opt,name=service_node,json=serviceNode,proto3" json:"service_node,omitempty"` + ServiceCluster string `protobuf:"bytes,2,opt,name=service_cluster,json=serviceCluster,proto3" json:"service_cluster,omitempty"` + ServiceZone string `protobuf:"bytes,3,opt,name=service_zone,json=serviceZone,proto3" json:"service_zone,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *NodeMetadata) Reset() { + *x = NodeMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeMetadata) ProtoMessage() {} + +func (x *NodeMetadata) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeMetadata.ProtoReflect.Descriptor instead. +func (*NodeMetadata) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{5} +} + +func (x *NodeMetadata) GetServiceNode() string { + if x != nil { + return x.ServiceNode + } + return "" +} + +func (x *NodeMetadata) GetServiceCluster() string { + if x != nil { + return x.ServiceCluster + } + return "" +} + +func (x *NodeMetadata) GetServiceZone() string { + if x != nil { + return x.ServiceZone + } + return "" +} + +func (x *NodeMetadata) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type ReadOperation_Include struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clusters bool `protobuf:"varint,1,opt,name=clusters,proto3" json:"clusters,omitempty"` + ConfigDump bool `protobuf:"varint,2,opt,name=config_dump,json=configDump,proto3" json:"config_dump,omitempty"` + Listeners bool `protobuf:"varint,3,opt,name=listeners,proto3" json:"listeners,omitempty"` + Runtime bool `protobuf:"varint,4,opt,name=runtime,proto3" json:"runtime,omitempty"` + Stats bool `protobuf:"varint,5,opt,name=stats,proto3" json:"stats,omitempty"` + ServerInfo bool `protobuf:"varint,6,opt,name=server_info,json=serverInfo,proto3" json:"server_info,omitempty"` +} + +func (x *ReadOperation_Include) Reset() { + *x = ReadOperation_Include{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadOperation_Include) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadOperation_Include) ProtoMessage() {} + +func (x *ReadOperation_Include) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadOperation_Include.ProtoReflect.Descriptor instead. +func (*ReadOperation_Include) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ReadOperation_Include) GetClusters() bool { + if x != nil { + return x.Clusters + } + return false +} + +func (x *ReadOperation_Include) GetConfigDump() bool { + if x != nil { + return x.ConfigDump + } + return false +} + +func (x *ReadOperation_Include) GetListeners() bool { + if x != nil { + return x.Listeners + } + return false +} + +func (x *ReadOperation_Include) GetRuntime() bool { + if x != nil { + return x.Runtime + } + return false +} + +func (x *ReadOperation_Include) GetStats() bool { + if x != nil { + return x.Stats + } + return false +} + +func (x *ReadOperation_Include) GetServerInfo() bool { + if x != nil { + return x.ServerInfo + } + return false +} + +type Result_Output struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clusters *Clusters `protobuf:"bytes,1,opt,name=clusters,proto3" json:"clusters,omitempty"` + ConfigDump *ConfigDump `protobuf:"bytes,2,opt,name=config_dump,json=configDump,proto3" json:"config_dump,omitempty"` + Listeners *Listeners `protobuf:"bytes,3,opt,name=listeners,proto3" json:"listeners,omitempty"` + Runtime *Runtime `protobuf:"bytes,4,opt,name=runtime,proto3" json:"runtime,omitempty"` + Stats *Stats `protobuf:"bytes,5,opt,name=stats,proto3" json:"stats,omitempty"` + ServerInfo *ServerInfo `protobuf:"bytes,6,opt,name=server_info,json=serverInfo,proto3" json:"server_info,omitempty"` +} + +func (x *Result_Output) Reset() { + *x = Result_Output{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Result_Output) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Result_Output) ProtoMessage() {} + +func (x *Result_Output) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_envoytriage_api_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Result_Output.ProtoReflect.Descriptor instead. +func (*Result_Output) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Result_Output) GetClusters() *Clusters { + if x != nil { + return x.Clusters + } + return nil +} + +func (x *Result_Output) GetConfigDump() *ConfigDump { + if x != nil { + return x.ConfigDump + } + return nil +} + +func (x *Result_Output) GetListeners() *Listeners { + if x != nil { + return x.Listeners + } + return nil +} + +func (x *Result_Output) GetRuntime() *Runtime { + if x != nil { + return x.Runtime + } + return nil +} + +func (x *Result_Output) GetStats() *Stats { + if x != nil { + return x.Stats + } + return nil +} + +func (x *Result_Output) GetServerInfo() *ServerInfo { + if x != nil { + return x.ServerInfo + } + return nil +} + +var File_envoytriage_v1_envoytriage_api_proto protoreflect.FileDescriptor + +var file_envoytriage_v1_envoytriage_api_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, + 0x69, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x0b, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0xd3, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x52, 0x07, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x1a, 0xb5, + 0x01, 0x0a, 0x07, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x44, 0x75, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, + 0x46, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x68, 0x6f, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xa8, + 0x01, 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x18, 0xff, 0xff, + 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0xc8, 0x04, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x48, 0x0a, 0x0d, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x06, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x1a, 0xfb, 0x02, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, + 0x3b, 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x73, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x42, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x44, 0x75, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x75, 0x6d, 0x70, + 0x12, 0x3e, 0x0a, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, + 0x12, 0x38, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x42, + 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5a, 0x6f, + 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x88, 0x01, 0x0a, + 0x0e, 0x45, 0x6e, 0x76, 0x6f, 0x79, 0x54, 0x72, 0x69, 0x61, 0x67, 0x65, 0x41, 0x50, 0x49, 0x12, + 0x76, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x3a, 0x01, + 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x42, 0x0f, 0x5a, 0x0d, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoytriage_v1_envoytriage_api_proto_rawDescOnce sync.Once + file_envoytriage_v1_envoytriage_api_proto_rawDescData = file_envoytriage_v1_envoytriage_api_proto_rawDesc +) + +func file_envoytriage_v1_envoytriage_api_proto_rawDescGZIP() []byte { + file_envoytriage_v1_envoytriage_api_proto_rawDescOnce.Do(func() { + file_envoytriage_v1_envoytriage_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoytriage_v1_envoytriage_api_proto_rawDescData) + }) + return file_envoytriage_v1_envoytriage_api_proto_rawDescData +} + +var file_envoytriage_v1_envoytriage_api_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_envoytriage_v1_envoytriage_api_proto_goTypes = []interface{}{ + (*ReadRequest)(nil), // 0: clutch.envoytriage.v1.ReadRequest + (*ReadOperation)(nil), // 1: clutch.envoytriage.v1.ReadOperation + (*ReadResponse)(nil), // 2: clutch.envoytriage.v1.ReadResponse + (*Address)(nil), // 3: clutch.envoytriage.v1.Address + (*Result)(nil), // 4: clutch.envoytriage.v1.Result + (*NodeMetadata)(nil), // 5: clutch.envoytriage.v1.NodeMetadata + (*ReadOperation_Include)(nil), // 6: clutch.envoytriage.v1.ReadOperation.Include + (*Result_Output)(nil), // 7: clutch.envoytriage.v1.Result.Output + (*Clusters)(nil), // 8: clutch.envoytriage.v1.Clusters + (*ConfigDump)(nil), // 9: clutch.envoytriage.v1.ConfigDump + (*Listeners)(nil), // 10: clutch.envoytriage.v1.Listeners + (*Runtime)(nil), // 11: clutch.envoytriage.v1.Runtime + (*Stats)(nil), // 12: clutch.envoytriage.v1.Stats + (*ServerInfo)(nil), // 13: clutch.envoytriage.v1.ServerInfo +} +var file_envoytriage_v1_envoytriage_api_proto_depIdxs = []int32{ + 1, // 0: clutch.envoytriage.v1.ReadRequest.operations:type_name -> clutch.envoytriage.v1.ReadOperation + 3, // 1: clutch.envoytriage.v1.ReadOperation.address:type_name -> clutch.envoytriage.v1.Address + 6, // 2: clutch.envoytriage.v1.ReadOperation.include:type_name -> clutch.envoytriage.v1.ReadOperation.Include + 4, // 3: clutch.envoytriage.v1.ReadResponse.results:type_name -> clutch.envoytriage.v1.Result + 3, // 4: clutch.envoytriage.v1.Result.address:type_name -> clutch.envoytriage.v1.Address + 5, // 5: clutch.envoytriage.v1.Result.node_metadata:type_name -> clutch.envoytriage.v1.NodeMetadata + 7, // 6: clutch.envoytriage.v1.Result.output:type_name -> clutch.envoytriage.v1.Result.Output + 8, // 7: clutch.envoytriage.v1.Result.Output.clusters:type_name -> clutch.envoytriage.v1.Clusters + 9, // 8: clutch.envoytriage.v1.Result.Output.config_dump:type_name -> clutch.envoytriage.v1.ConfigDump + 10, // 9: clutch.envoytriage.v1.Result.Output.listeners:type_name -> clutch.envoytriage.v1.Listeners + 11, // 10: clutch.envoytriage.v1.Result.Output.runtime:type_name -> clutch.envoytriage.v1.Runtime + 12, // 11: clutch.envoytriage.v1.Result.Output.stats:type_name -> clutch.envoytriage.v1.Stats + 13, // 12: clutch.envoytriage.v1.Result.Output.server_info:type_name -> clutch.envoytriage.v1.ServerInfo + 0, // 13: clutch.envoytriage.v1.EnvoyTriageAPI.Read:input_type -> clutch.envoytriage.v1.ReadRequest + 2, // 14: clutch.envoytriage.v1.EnvoyTriageAPI.Read:output_type -> clutch.envoytriage.v1.ReadResponse + 14, // [14:15] is the sub-list for method output_type + 13, // [13:14] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_envoytriage_v1_envoytriage_api_proto_init() } +func file_envoytriage_v1_envoytriage_api_proto_init() { + if File_envoytriage_v1_envoytriage_api_proto != nil { + return + } + file_envoytriage_v1_output_proto_init() + if !protoimpl.UnsafeEnabled { + file_envoytriage_v1_envoytriage_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadOperation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Address); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Result); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadOperation_Include); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_envoytriage_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Result_Output); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoytriage_v1_envoytriage_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_envoytriage_v1_envoytriage_api_proto_goTypes, + DependencyIndexes: file_envoytriage_v1_envoytriage_api_proto_depIdxs, + MessageInfos: file_envoytriage_v1_envoytriage_api_proto_msgTypes, + }.Build() + File_envoytriage_v1_envoytriage_api_proto = out.File + file_envoytriage_v1_envoytriage_api_proto_rawDesc = nil + file_envoytriage_v1_envoytriage_api_proto_goTypes = nil + file_envoytriage_v1_envoytriage_api_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// EnvoyTriageAPIClient is the client API for EnvoyTriageAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type EnvoyTriageAPIClient interface { + Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) +} + +type envoyTriageAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewEnvoyTriageAPIClient(cc grpc.ClientConnInterface) EnvoyTriageAPIClient { + return &envoyTriageAPIClient{cc} +} + +func (c *envoyTriageAPIClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) { + out := new(ReadResponse) + err := c.cc.Invoke(ctx, "/clutch.envoytriage.v1.EnvoyTriageAPI/Read", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EnvoyTriageAPIServer is the server API for EnvoyTriageAPI service. +type EnvoyTriageAPIServer interface { + Read(context.Context, *ReadRequest) (*ReadResponse, error) +} + +// UnimplementedEnvoyTriageAPIServer can be embedded to have forward compatible implementations. +type UnimplementedEnvoyTriageAPIServer struct { +} + +func (*UnimplementedEnvoyTriageAPIServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") +} + +func RegisterEnvoyTriageAPIServer(s *grpc.Server, srv EnvoyTriageAPIServer) { + s.RegisterService(&_EnvoyTriageAPI_serviceDesc, srv) +} + +func _EnvoyTriageAPI_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnvoyTriageAPIServer).Read(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.envoytriage.v1.EnvoyTriageAPI/Read", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnvoyTriageAPIServer).Read(ctx, req.(*ReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _EnvoyTriageAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.envoytriage.v1.EnvoyTriageAPI", + HandlerType: (*EnvoyTriageAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Read", + Handler: _EnvoyTriageAPI_Read_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "envoytriage/v1/envoytriage_api.proto", +} diff --git a/backend/api/envoytriage/v1/envoytriage_api.pb.gw.go b/backend/api/envoytriage/v1/envoytriage_api.pb.gw.go new file mode 100644 index 0000000000..32789e25c1 --- /dev/null +++ b/backend/api/envoytriage/v1/envoytriage_api.pb.gw.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: envoytriage/v1/envoytriage_api.proto + +/* +Package envoytriagev1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package envoytriagev1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_EnvoyTriageAPI_Read_0(ctx context.Context, marshaler runtime.Marshaler, client EnvoyTriageAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReadRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_EnvoyTriageAPI_Read_0(ctx context.Context, marshaler runtime.Marshaler, server EnvoyTriageAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReadRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Read(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterEnvoyTriageAPIHandlerServer registers the http handlers for service EnvoyTriageAPI to "mux". +// UnaryRPC :call EnvoyTriageAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEnvoyTriageAPIHandlerFromEndpoint instead. +func RegisterEnvoyTriageAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EnvoyTriageAPIServer) error { + + mux.Handle("POST", pattern_EnvoyTriageAPI_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.envoytriage.v1.EnvoyTriageAPI/Read") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_EnvoyTriageAPI_Read_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EnvoyTriageAPI_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterEnvoyTriageAPIHandlerFromEndpoint is same as RegisterEnvoyTriageAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterEnvoyTriageAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterEnvoyTriageAPIHandler(ctx, mux, conn) +} + +// RegisterEnvoyTriageAPIHandler registers the http handlers for service EnvoyTriageAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterEnvoyTriageAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterEnvoyTriageAPIHandlerClient(ctx, mux, NewEnvoyTriageAPIClient(conn)) +} + +// RegisterEnvoyTriageAPIHandlerClient registers the http handlers for service EnvoyTriageAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EnvoyTriageAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EnvoyTriageAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "EnvoyTriageAPIClient" to call the correct interceptors. +func RegisterEnvoyTriageAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EnvoyTriageAPIClient) error { + + mux.Handle("POST", pattern_EnvoyTriageAPI_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.envoytriage.v1.EnvoyTriageAPI/Read") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EnvoyTriageAPI_Read_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EnvoyTriageAPI_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_EnvoyTriageAPI_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "envoytriage", "read"}, "")) +) + +var ( + forward_EnvoyTriageAPI_Read_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/envoytriage/v1/envoytriage_api.pb.validate.go b/backend/api/envoytriage/v1/envoytriage_api.pb.validate.go new file mode 100644 index 0000000000..461e5681c2 --- /dev/null +++ b/backend/api/envoytriage/v1/envoytriage_api.pb.validate.go @@ -0,0 +1,770 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoytriage/v1/envoytriage_api.proto + +package envoytriagev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _envoytriage_api_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on ReadRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ReadRequest) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetOperations() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ReadRequestValidationError{ + field: fmt.Sprintf("Operations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ReadRequestValidationError is the validation error returned by +// ReadRequest.Validate if the designated constraints aren't met. +type ReadRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ReadRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ReadRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ReadRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ReadRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ReadRequestValidationError) ErrorName() string { return "ReadRequestValidationError" } + +// Error satisfies the builtin error interface +func (e ReadRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sReadRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ReadRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ReadRequestValidationError{} + +// Validate checks the field values on ReadOperation with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ReadOperation) Validate() error { + if m == nil { + return nil + } + + if m.GetAddress() == nil { + return ReadOperationValidationError{ + field: "Address", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ReadOperationValidationError{ + field: "Address", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetInclude()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ReadOperationValidationError{ + field: "Include", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ReadOperationValidationError is the validation error returned by +// ReadOperation.Validate if the designated constraints aren't met. +type ReadOperationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ReadOperationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ReadOperationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ReadOperationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ReadOperationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ReadOperationValidationError) ErrorName() string { return "ReadOperationValidationError" } + +// Error satisfies the builtin error interface +func (e ReadOperationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sReadOperation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ReadOperationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ReadOperationValidationError{} + +// Validate checks the field values on ReadResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ReadResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetResults() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ReadResponseValidationError{ + field: fmt.Sprintf("Results[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ReadResponseValidationError is the validation error returned by +// ReadResponse.Validate if the designated constraints aren't met. +type ReadResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ReadResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ReadResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ReadResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ReadResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ReadResponseValidationError) ErrorName() string { return "ReadResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ReadResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sReadResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ReadResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ReadResponseValidationError{} + +// Validate checks the field values on Address with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Address) Validate() error { + if m == nil { + return nil + } + + if err := m._validateHostname(m.GetHost()); err != nil { + if ip := net.ParseIP(m.GetHost()); ip == nil { + return AddressValidationError{ + field: "Host", + reason: "value must be a valid hostname, or ip address", + } + } + } + + if m.GetPort() > 65535 { + return AddressValidationError{ + field: "Port", + reason: "value must be less than or equal to 65535", + } + } + + return nil +} + +func (m *Address) _validateHostname(host string) error { + s := strings.ToLower(strings.TrimSuffix(host, ".")) + + if len(host) > 253 { + return errors.New("hostname cannot exceed 253 characters") + } + + for _, part := range strings.Split(s, ".") { + if l := len(part); l == 0 || l > 63 { + return errors.New("hostname part must be non-empty and cannot exceed 63 characters") + } + + if part[0] == '-' { + return errors.New("hostname parts cannot begin with hyphens") + } + + if part[len(part)-1] == '-' { + return errors.New("hostname parts cannot end with hyphens") + } + + for _, r := range part { + if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { + return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) + } + } + } + + return nil +} + +// AddressValidationError is the validation error returned by Address.Validate +// if the designated constraints aren't met. +type AddressValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AddressValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AddressValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AddressValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AddressValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AddressValidationError) ErrorName() string { return "AddressValidationError" } + +// Error satisfies the builtin error interface +func (e AddressValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAddress.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AddressValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AddressValidationError{} + +// Validate checks the field values on Result with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Result) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResultValidationError{ + field: "Address", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetNodeMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResultValidationError{ + field: "NodeMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetOutput()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResultValidationError{ + field: "Output", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ResultValidationError is the validation error returned by Result.Validate if +// the designated constraints aren't met. +type ResultValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResultValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResultValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResultValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResultValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResultValidationError) ErrorName() string { return "ResultValidationError" } + +// Error satisfies the builtin error interface +func (e ResultValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResult.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResultValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResultValidationError{} + +// Validate checks the field values on NodeMetadata with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *NodeMetadata) Validate() error { + if m == nil { + return nil + } + + // no validation rules for ServiceNode + + // no validation rules for ServiceCluster + + // no validation rules for ServiceZone + + // no validation rules for Version + + return nil +} + +// NodeMetadataValidationError is the validation error returned by +// NodeMetadata.Validate if the designated constraints aren't met. +type NodeMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NodeMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NodeMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NodeMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NodeMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NodeMetadataValidationError) ErrorName() string { return "NodeMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e NodeMetadataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNodeMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NodeMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NodeMetadataValidationError{} + +// Validate checks the field values on ReadOperation_Include with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ReadOperation_Include) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Clusters + + // no validation rules for ConfigDump + + // no validation rules for Listeners + + // no validation rules for Runtime + + // no validation rules for Stats + + // no validation rules for ServerInfo + + return nil +} + +// ReadOperation_IncludeValidationError is the validation error returned by +// ReadOperation_Include.Validate if the designated constraints aren't met. +type ReadOperation_IncludeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ReadOperation_IncludeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ReadOperation_IncludeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ReadOperation_IncludeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ReadOperation_IncludeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ReadOperation_IncludeValidationError) ErrorName() string { + return "ReadOperation_IncludeValidationError" +} + +// Error satisfies the builtin error interface +func (e ReadOperation_IncludeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sReadOperation_Include.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ReadOperation_IncludeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ReadOperation_IncludeValidationError{} + +// Validate checks the field values on Result_Output with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *Result_Output) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetClusters()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "Clusters", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetConfigDump()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "ConfigDump", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetListeners()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "Listeners", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "Runtime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetStats()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "Stats", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetServerInfo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Result_OutputValidationError{ + field: "ServerInfo", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// Result_OutputValidationError is the validation error returned by +// Result_Output.Validate if the designated constraints aren't met. +type Result_OutputValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Result_OutputValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Result_OutputValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Result_OutputValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Result_OutputValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Result_OutputValidationError) ErrorName() string { return "Result_OutputValidationError" } + +// Error satisfies the builtin error interface +func (e Result_OutputValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResult_Output.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Result_OutputValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Result_OutputValidationError{} diff --git a/backend/api/envoytriage/v1/output.pb.go b/backend/api/envoytriage/v1/output.pb.go new file mode 100644 index 0000000000..160c52c080 --- /dev/null +++ b/backend/api/envoytriage/v1/output.pb.go @@ -0,0 +1,871 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: envoytriage/v1/output.proto + +package envoytriagev1 + +import ( + proto "github.com/golang/protobuf/proto" + _struct "github.com/golang/protobuf/ptypes/struct" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type HostStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Healthy bool `protobuf:"varint,2,opt,name=healthy,proto3" json:"healthy,omitempty"` +} + +func (x *HostStatus) Reset() { + *x = HostStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HostStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HostStatus) ProtoMessage() {} + +func (x *HostStatus) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HostStatus.ProtoReflect.Descriptor instead. +func (*HostStatus) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{0} +} + +func (x *HostStatus) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *HostStatus) GetHealthy() bool { + if x != nil { + return x.Healthy + } + return false +} + +type ClusterStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + HostStatuses []*HostStatus `protobuf:"bytes,2,rep,name=host_statuses,json=hostStatuses,proto3" json:"host_statuses,omitempty"` +} + +func (x *ClusterStatus) Reset() { + *x = ClusterStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterStatus) ProtoMessage() {} + +func (x *ClusterStatus) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterStatus.ProtoReflect.Descriptor instead. +func (*ClusterStatus) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{1} +} + +func (x *ClusterStatus) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterStatus) GetHostStatuses() []*HostStatus { + if x != nil { + return x.HostStatuses + } + return nil +} + +type Clusters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterStatuses []*ClusterStatus `protobuf:"bytes,1,rep,name=cluster_statuses,json=clusterStatuses,proto3" json:"cluster_statuses,omitempty"` +} + +func (x *Clusters) Reset() { + *x = Clusters{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Clusters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Clusters) ProtoMessage() {} + +func (x *Clusters) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Clusters.ProtoReflect.Descriptor instead. +func (*Clusters) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{2} +} + +func (x *Clusters) GetClusterStatuses() []*ClusterStatus { + if x != nil { + return x.ClusterStatuses + } + return nil +} + +type ConfigDump struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *_struct.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ConfigDump) Reset() { + *x = ConfigDump{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigDump) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigDump) ProtoMessage() {} + +func (x *ConfigDump) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigDump.ProtoReflect.Descriptor instead. +func (*ConfigDump) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigDump) GetValue() *_struct.Value { + if x != nil { + return x.Value + } + return nil +} + +type ListenerStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + LocalAddress string `protobuf:"bytes,2,opt,name=local_address,json=localAddress,proto3" json:"local_address,omitempty"` +} + +func (x *ListenerStatus) Reset() { + *x = ListenerStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenerStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenerStatus) ProtoMessage() {} + +func (x *ListenerStatus) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListenerStatus.ProtoReflect.Descriptor instead. +func (*ListenerStatus) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{4} +} + +func (x *ListenerStatus) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListenerStatus) GetLocalAddress() string { + if x != nil { + return x.LocalAddress + } + return "" +} + +type Listeners struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ListenerStatuses []*ListenerStatus `protobuf:"bytes,1,rep,name=listener_statuses,json=listenerStatuses,proto3" json:"listener_statuses,omitempty"` +} + +func (x *Listeners) Reset() { + *x = Listeners{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Listeners) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Listeners) ProtoMessage() {} + +func (x *Listeners) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Listeners.ProtoReflect.Descriptor instead. +func (*Listeners) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{5} +} + +func (x *Listeners) GetListenerStatuses() []*ListenerStatus { + if x != nil { + return x.ListenerStatuses + } + return nil +} + +type Runtime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entries []*Runtime_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *Runtime) Reset() { + *x = Runtime{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Runtime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Runtime) ProtoMessage() {} + +func (x *Runtime) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Runtime.ProtoReflect.Descriptor instead. +func (*Runtime) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{6} +} + +func (x *Runtime) GetEntries() []*Runtime_Entry { + if x != nil { + return x.Entries + } + return nil +} + +type ServerInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *_struct.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ServerInfo) Reset() { + *x = ServerInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerInfo) ProtoMessage() {} + +func (x *ServerInfo) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerInfo.ProtoReflect.Descriptor instead. +func (*ServerInfo) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{7} +} + +func (x *ServerInfo) GetValue() *_struct.Value { + if x != nil { + return x.Value + } + return nil +} + +type Stats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Counters and gauges are returned here. + Stats []*Stats_Stat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` +} + +func (x *Stats) Reset() { + *x = Stats{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats) ProtoMessage() {} + +func (x *Stats) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats.ProtoReflect.Descriptor instead. +func (*Stats) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{8} +} + +func (x *Stats) GetStats() []*Stats_Stat { + if x != nil { + return x.Stats + } + return nil +} + +type Runtime_Entry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Types that are assignable to Type: + // *Runtime_Entry_Value + Type isRuntime_Entry_Type `protobuf_oneof:"type"` +} + +func (x *Runtime_Entry) Reset() { + *x = Runtime_Entry{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Runtime_Entry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Runtime_Entry) ProtoMessage() {} + +func (x *Runtime_Entry) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Runtime_Entry.ProtoReflect.Descriptor instead. +func (*Runtime_Entry) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *Runtime_Entry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (m *Runtime_Entry) GetType() isRuntime_Entry_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *Runtime_Entry) GetValue() string { + if x, ok := x.GetType().(*Runtime_Entry_Value); ok { + return x.Value + } + return "" +} + +type isRuntime_Entry_Type interface { + isRuntime_Entry_Type() +} + +type Runtime_Entry_Value struct { + Value string `protobuf:"bytes,2,opt,name=value,proto3,oneof"` +} + +func (*Runtime_Entry_Value) isRuntime_Entry_Type() {} + +type Stats_Stat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Stats_Stat) Reset() { + *x = Stats_Stat{} + if protoimpl.UnsafeEnabled { + mi := &file_envoytriage_v1_output_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats_Stat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats_Stat) ProtoMessage() {} + +func (x *Stats_Stat) ProtoReflect() protoreflect.Message { + mi := &file_envoytriage_v1_output_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats_Stat.ProtoReflect.Descriptor instead. +func (*Stats_Stat) Descriptor() ([]byte, []int) { + return file_envoytriage_v1_output_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *Stats_Stat) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Stats_Stat) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +var File_envoytriage_v1_output_proto protoreflect.FileDescriptor + +var file_envoytriage_v1_output_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, + 0x2f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x79, 0x22, 0x6b, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x0d, 0x68, 0x6f, 0x73, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, + 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x0c, 0x68, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, + 0x73, 0x22, 0x5b, 0x0a, 0x08, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x4f, 0x0a, + 0x10, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0f, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x22, 0x3a, + 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x75, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x49, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x5f, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, + 0x72, 0x73, 0x12, 0x52, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x0a, + 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x70, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x12, 0x37, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x2e, 0x0a, 0x04, 0x53, + 0x74, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x74, 0x72, 0x69, 0x61, 0x67, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoytriage_v1_output_proto_rawDescOnce sync.Once + file_envoytriage_v1_output_proto_rawDescData = file_envoytriage_v1_output_proto_rawDesc +) + +func file_envoytriage_v1_output_proto_rawDescGZIP() []byte { + file_envoytriage_v1_output_proto_rawDescOnce.Do(func() { + file_envoytriage_v1_output_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoytriage_v1_output_proto_rawDescData) + }) + return file_envoytriage_v1_output_proto_rawDescData +} + +var file_envoytriage_v1_output_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_envoytriage_v1_output_proto_goTypes = []interface{}{ + (*HostStatus)(nil), // 0: clutch.envoytriage.v1.HostStatus + (*ClusterStatus)(nil), // 1: clutch.envoytriage.v1.ClusterStatus + (*Clusters)(nil), // 2: clutch.envoytriage.v1.Clusters + (*ConfigDump)(nil), // 3: clutch.envoytriage.v1.ConfigDump + (*ListenerStatus)(nil), // 4: clutch.envoytriage.v1.ListenerStatus + (*Listeners)(nil), // 5: clutch.envoytriage.v1.Listeners + (*Runtime)(nil), // 6: clutch.envoytriage.v1.Runtime + (*ServerInfo)(nil), // 7: clutch.envoytriage.v1.ServerInfo + (*Stats)(nil), // 8: clutch.envoytriage.v1.Stats + (*Runtime_Entry)(nil), // 9: clutch.envoytriage.v1.Runtime.Entry + (*Stats_Stat)(nil), // 10: clutch.envoytriage.v1.Stats.Stat + (*_struct.Value)(nil), // 11: google.protobuf.Value +} +var file_envoytriage_v1_output_proto_depIdxs = []int32{ + 0, // 0: clutch.envoytriage.v1.ClusterStatus.host_statuses:type_name -> clutch.envoytriage.v1.HostStatus + 1, // 1: clutch.envoytriage.v1.Clusters.cluster_statuses:type_name -> clutch.envoytriage.v1.ClusterStatus + 11, // 2: clutch.envoytriage.v1.ConfigDump.value:type_name -> google.protobuf.Value + 4, // 3: clutch.envoytriage.v1.Listeners.listener_statuses:type_name -> clutch.envoytriage.v1.ListenerStatus + 9, // 4: clutch.envoytriage.v1.Runtime.entries:type_name -> clutch.envoytriage.v1.Runtime.Entry + 11, // 5: clutch.envoytriage.v1.ServerInfo.value:type_name -> google.protobuf.Value + 10, // 6: clutch.envoytriage.v1.Stats.stats:type_name -> clutch.envoytriage.v1.Stats.Stat + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_envoytriage_v1_output_proto_init() } +func file_envoytriage_v1_output_proto_init() { + if File_envoytriage_v1_output_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoytriage_v1_output_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HostStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Clusters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigDump); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenerStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Listeners); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Runtime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Runtime_Entry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoytriage_v1_output_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats_Stat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_envoytriage_v1_output_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*Runtime_Entry_Value)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoytriage_v1_output_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoytriage_v1_output_proto_goTypes, + DependencyIndexes: file_envoytriage_v1_output_proto_depIdxs, + MessageInfos: file_envoytriage_v1_output_proto_msgTypes, + }.Build() + File_envoytriage_v1_output_proto = out.File + file_envoytriage_v1_output_proto_rawDesc = nil + file_envoytriage_v1_output_proto_goTypes = nil + file_envoytriage_v1_output_proto_depIdxs = nil +} diff --git a/backend/api/envoytriage/v1/output.pb.validate.go b/backend/api/envoytriage/v1/output.pb.validate.go new file mode 100644 index 0000000000..649e407927 --- /dev/null +++ b/backend/api/envoytriage/v1/output.pb.validate.go @@ -0,0 +1,862 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoytriage/v1/output.proto + +package envoytriagev1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _output_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on HostStatus with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HostStatus) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Address + + // no validation rules for Healthy + + return nil +} + +// HostStatusValidationError is the validation error returned by +// HostStatus.Validate if the designated constraints aren't met. +type HostStatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HostStatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HostStatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HostStatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HostStatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HostStatusValidationError) ErrorName() string { return "HostStatusValidationError" } + +// Error satisfies the builtin error interface +func (e HostStatusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHostStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HostStatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HostStatusValidationError{} + +// Validate checks the field values on ClusterStatus with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ClusterStatus) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + for idx, item := range m.GetHostStatuses() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterStatusValidationError{ + field: fmt.Sprintf("HostStatuses[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ClusterStatusValidationError is the validation error returned by +// ClusterStatus.Validate if the designated constraints aren't met. +type ClusterStatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClusterStatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClusterStatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClusterStatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClusterStatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClusterStatusValidationError) ErrorName() string { return "ClusterStatusValidationError" } + +// Error satisfies the builtin error interface +func (e ClusterStatusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClusterStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClusterStatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClusterStatusValidationError{} + +// Validate checks the field values on Clusters with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Clusters) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetClusterStatuses() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClustersValidationError{ + field: fmt.Sprintf("ClusterStatuses[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ClustersValidationError is the validation error returned by +// Clusters.Validate if the designated constraints aren't met. +type ClustersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClustersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClustersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClustersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClustersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClustersValidationError) ErrorName() string { return "ClustersValidationError" } + +// Error satisfies the builtin error interface +func (e ClustersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClusters.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClustersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClustersValidationError{} + +// Validate checks the field values on ConfigDump with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *ConfigDump) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigDumpValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ConfigDumpValidationError is the validation error returned by +// ConfigDump.Validate if the designated constraints aren't met. +type ConfigDumpValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfigDumpValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfigDumpValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfigDumpValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfigDumpValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfigDumpValidationError) ErrorName() string { return "ConfigDumpValidationError" } + +// Error satisfies the builtin error interface +func (e ConfigDumpValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfigDump.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfigDumpValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfigDumpValidationError{} + +// Validate checks the field values on ListenerStatus with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ListenerStatus) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for LocalAddress + + return nil +} + +// ListenerStatusValidationError is the validation error returned by +// ListenerStatus.Validate if the designated constraints aren't met. +type ListenerStatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListenerStatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListenerStatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListenerStatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListenerStatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListenerStatusValidationError) ErrorName() string { return "ListenerStatusValidationError" } + +// Error satisfies the builtin error interface +func (e ListenerStatusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListenerStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListenerStatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListenerStatusValidationError{} + +// Validate checks the field values on Listeners with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Listeners) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetListenerStatuses() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenersValidationError{ + field: fmt.Sprintf("ListenerStatuses[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ListenersValidationError is the validation error returned by +// Listeners.Validate if the designated constraints aren't met. +type ListenersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListenersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListenersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListenersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListenersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListenersValidationError) ErrorName() string { return "ListenersValidationError" } + +// Error satisfies the builtin error interface +func (e ListenersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListeners.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListenersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListenersValidationError{} + +// Validate checks the field values on Runtime with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Runtime) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetEntries() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RuntimeValidationError{ + field: fmt.Sprintf("Entries[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// RuntimeValidationError is the validation error returned by Runtime.Validate +// if the designated constraints aren't met. +type RuntimeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RuntimeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RuntimeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RuntimeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RuntimeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" } + +// Error satisfies the builtin error interface +func (e RuntimeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRuntime.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RuntimeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RuntimeValidationError{} + +// Validate checks the field values on ServerInfo with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *ServerInfo) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ServerInfoValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ServerInfoValidationError is the validation error returned by +// ServerInfo.Validate if the designated constraints aren't met. +type ServerInfoValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ServerInfoValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ServerInfoValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ServerInfoValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ServerInfoValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ServerInfoValidationError) ErrorName() string { return "ServerInfoValidationError" } + +// Error satisfies the builtin error interface +func (e ServerInfoValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sServerInfo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ServerInfoValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ServerInfoValidationError{} + +// Validate checks the field values on Stats with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Stats) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetStats() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsValidationError{ + field: fmt.Sprintf("Stats[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// StatsValidationError is the validation error returned by Stats.Validate if +// the designated constraints aren't met. +type StatsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StatsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StatsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StatsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StatsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StatsValidationError) ErrorName() string { return "StatsValidationError" } + +// Error satisfies the builtin error interface +func (e StatsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StatsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StatsValidationError{} + +// Validate checks the field values on Runtime_Entry with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *Runtime_Entry) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Key + + switch m.Type.(type) { + + case *Runtime_Entry_Value: + // no validation rules for Value + + } + + return nil +} + +// Runtime_EntryValidationError is the validation error returned by +// Runtime_Entry.Validate if the designated constraints aren't met. +type Runtime_EntryValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Runtime_EntryValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Runtime_EntryValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Runtime_EntryValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Runtime_EntryValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Runtime_EntryValidationError) ErrorName() string { return "Runtime_EntryValidationError" } + +// Error satisfies the builtin error interface +func (e Runtime_EntryValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRuntime_Entry.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Runtime_EntryValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Runtime_EntryValidationError{} + +// Validate checks the field values on Stats_Stat with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Stats_Stat) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Key + + // no validation rules for Value + + return nil +} + +// Stats_StatValidationError is the validation error returned by +// Stats_Stat.Validate if the designated constraints aren't met. +type Stats_StatValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Stats_StatValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Stats_StatValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Stats_StatValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Stats_StatValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Stats_StatValidationError) ErrorName() string { return "Stats_StatValidationError" } + +// Error satisfies the builtin error interface +func (e Stats_StatValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStats_Stat.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Stats_StatValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Stats_StatValidationError{} diff --git a/backend/api/healthcheck/v1/healthcheck.pb.go b/backend/api/healthcheck/v1/healthcheck.pb.go new file mode 100644 index 0000000000..6a2ce0c2f1 --- /dev/null +++ b/backend/api/healthcheck/v1/healthcheck.pb.go @@ -0,0 +1,293 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: healthcheck/v1/healthcheck.proto + +package healthcheckv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type HealthcheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HealthcheckRequest) Reset() { + *x = HealthcheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthcheck_v1_healthcheck_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthcheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthcheckRequest) ProtoMessage() {} + +func (x *HealthcheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthcheck_v1_healthcheck_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthcheckRequest.ProtoReflect.Descriptor instead. +func (*HealthcheckRequest) Descriptor() ([]byte, []int) { + return file_healthcheck_v1_healthcheck_proto_rawDescGZIP(), []int{0} +} + +type HealthcheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HealthcheckResponse) Reset() { + *x = HealthcheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthcheck_v1_healthcheck_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthcheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthcheckResponse) ProtoMessage() {} + +func (x *HealthcheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthcheck_v1_healthcheck_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthcheckResponse.ProtoReflect.Descriptor instead. +func (*HealthcheckResponse) Descriptor() ([]byte, []int) { + return file_healthcheck_v1_healthcheck_proto_rawDescGZIP(), []int{1} +} + +var File_healthcheck_v1_healthcheck_proto protoreflect.FileDescriptor + +var file_healthcheck_v1_healthcheck_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2f, 0x76, 0x31, + 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa6, + 0x01, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x50, + 0x49, 0x12, 0x93, 0x01, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x12, 0x29, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x5a, 0x0e, 0x12, 0x0c, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x42, 0x0f, 0x5a, 0x0d, 0x68, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_healthcheck_v1_healthcheck_proto_rawDescOnce sync.Once + file_healthcheck_v1_healthcheck_proto_rawDescData = file_healthcheck_v1_healthcheck_proto_rawDesc +) + +func file_healthcheck_v1_healthcheck_proto_rawDescGZIP() []byte { + file_healthcheck_v1_healthcheck_proto_rawDescOnce.Do(func() { + file_healthcheck_v1_healthcheck_proto_rawDescData = protoimpl.X.CompressGZIP(file_healthcheck_v1_healthcheck_proto_rawDescData) + }) + return file_healthcheck_v1_healthcheck_proto_rawDescData +} + +var file_healthcheck_v1_healthcheck_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_healthcheck_v1_healthcheck_proto_goTypes = []interface{}{ + (*HealthcheckRequest)(nil), // 0: clutch.healthcheck.v1.HealthcheckRequest + (*HealthcheckResponse)(nil), // 1: clutch.healthcheck.v1.HealthcheckResponse +} +var file_healthcheck_v1_healthcheck_proto_depIdxs = []int32{ + 0, // 0: clutch.healthcheck.v1.HealthcheckAPI.Healthcheck:input_type -> clutch.healthcheck.v1.HealthcheckRequest + 1, // 1: clutch.healthcheck.v1.HealthcheckAPI.Healthcheck:output_type -> clutch.healthcheck.v1.HealthcheckResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_healthcheck_v1_healthcheck_proto_init() } +func file_healthcheck_v1_healthcheck_proto_init() { + if File_healthcheck_v1_healthcheck_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_healthcheck_v1_healthcheck_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthcheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthcheck_v1_healthcheck_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthcheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_healthcheck_v1_healthcheck_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_healthcheck_v1_healthcheck_proto_goTypes, + DependencyIndexes: file_healthcheck_v1_healthcheck_proto_depIdxs, + MessageInfos: file_healthcheck_v1_healthcheck_proto_msgTypes, + }.Build() + File_healthcheck_v1_healthcheck_proto = out.File + file_healthcheck_v1_healthcheck_proto_rawDesc = nil + file_healthcheck_v1_healthcheck_proto_goTypes = nil + file_healthcheck_v1_healthcheck_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// HealthcheckAPIClient is the client API for HealthcheckAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type HealthcheckAPIClient interface { + Healthcheck(ctx context.Context, in *HealthcheckRequest, opts ...grpc.CallOption) (*HealthcheckResponse, error) +} + +type healthcheckAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewHealthcheckAPIClient(cc grpc.ClientConnInterface) HealthcheckAPIClient { + return &healthcheckAPIClient{cc} +} + +func (c *healthcheckAPIClient) Healthcheck(ctx context.Context, in *HealthcheckRequest, opts ...grpc.CallOption) (*HealthcheckResponse, error) { + out := new(HealthcheckResponse) + err := c.cc.Invoke(ctx, "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HealthcheckAPIServer is the server API for HealthcheckAPI service. +type HealthcheckAPIServer interface { + Healthcheck(context.Context, *HealthcheckRequest) (*HealthcheckResponse, error) +} + +// UnimplementedHealthcheckAPIServer can be embedded to have forward compatible implementations. +type UnimplementedHealthcheckAPIServer struct { +} + +func (*UnimplementedHealthcheckAPIServer) Healthcheck(context.Context, *HealthcheckRequest) (*HealthcheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Healthcheck not implemented") +} + +func RegisterHealthcheckAPIServer(s *grpc.Server, srv HealthcheckAPIServer) { + s.RegisterService(&_HealthcheckAPI_serviceDesc, srv) +} + +func _HealthcheckAPI_Healthcheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthcheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthcheckAPIServer).Healthcheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthcheckAPIServer).Healthcheck(ctx, req.(*HealthcheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _HealthcheckAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.healthcheck.v1.HealthcheckAPI", + HandlerType: (*HealthcheckAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Healthcheck", + Handler: _HealthcheckAPI_Healthcheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "healthcheck/v1/healthcheck.proto", +} diff --git a/backend/api/healthcheck/v1/healthcheck.pb.gw.go b/backend/api/healthcheck/v1/healthcheck.pb.gw.go new file mode 100644 index 0000000000..19a1094280 --- /dev/null +++ b/backend/api/healthcheck/v1/healthcheck.pb.gw.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: healthcheck/v1/healthcheck.proto + +/* +Package healthcheckv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package healthcheckv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_HealthcheckAPI_Healthcheck_0(ctx context.Context, marshaler runtime.Marshaler, client HealthcheckAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HealthcheckRequest + var metadata runtime.ServerMetadata + + msg, err := client.Healthcheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HealthcheckAPI_Healthcheck_0(ctx context.Context, marshaler runtime.Marshaler, server HealthcheckAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HealthcheckRequest + var metadata runtime.ServerMetadata + + msg, err := server.Healthcheck(ctx, &protoReq) + return msg, metadata, err + +} + +func request_HealthcheckAPI_Healthcheck_1(ctx context.Context, marshaler runtime.Marshaler, client HealthcheckAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HealthcheckRequest + var metadata runtime.ServerMetadata + + msg, err := client.Healthcheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HealthcheckAPI_Healthcheck_1(ctx context.Context, marshaler runtime.Marshaler, server HealthcheckAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HealthcheckRequest + var metadata runtime.ServerMetadata + + msg, err := server.Healthcheck(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterHealthcheckAPIHandlerServer registers the http handlers for service HealthcheckAPI to "mux". +// UnaryRPC :call HealthcheckAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthcheckAPIHandlerFromEndpoint instead. +func RegisterHealthcheckAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthcheckAPIServer) error { + + mux.Handle("GET", pattern_HealthcheckAPI_Healthcheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HealthcheckAPI_Healthcheck_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthcheckAPI_Healthcheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HealthcheckAPI_Healthcheck_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HealthcheckAPI_Healthcheck_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthcheckAPI_Healthcheck_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterHealthcheckAPIHandlerFromEndpoint is same as RegisterHealthcheckAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterHealthcheckAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterHealthcheckAPIHandler(ctx, mux, conn) +} + +// RegisterHealthcheckAPIHandler registers the http handlers for service HealthcheckAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterHealthcheckAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterHealthcheckAPIHandlerClient(ctx, mux, NewHealthcheckAPIClient(conn)) +} + +// RegisterHealthcheckAPIHandlerClient registers the http handlers for service HealthcheckAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthcheckAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthcheckAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "HealthcheckAPIClient" to call the correct interceptors. +func RegisterHealthcheckAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthcheckAPIClient) error { + + mux.Handle("GET", pattern_HealthcheckAPI_Healthcheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HealthcheckAPI_Healthcheck_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthcheckAPI_Healthcheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HealthcheckAPI_Healthcheck_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.healthcheck.v1.HealthcheckAPI/Healthcheck") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HealthcheckAPI_Healthcheck_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthcheckAPI_Healthcheck_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_HealthcheckAPI_Healthcheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "healthcheck"}, "")) + + pattern_HealthcheckAPI_Healthcheck_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"healthcheck"}, "")) +) + +var ( + forward_HealthcheckAPI_Healthcheck_0 = runtime.ForwardResponseMessage + + forward_HealthcheckAPI_Healthcheck_1 = runtime.ForwardResponseMessage +) diff --git a/backend/api/healthcheck/v1/healthcheck.pb.validate.go b/backend/api/healthcheck/v1/healthcheck.pb.validate.go new file mode 100644 index 0000000000..85b0d00e94 --- /dev/null +++ b/backend/api/healthcheck/v1/healthcheck.pb.validate.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: healthcheck/v1/healthcheck.proto + +package healthcheckv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _healthcheck_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on HealthcheckRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthcheckRequest) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// HealthcheckRequestValidationError is the validation error returned by +// HealthcheckRequest.Validate if the designated constraints aren't met. +type HealthcheckRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HealthcheckRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HealthcheckRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HealthcheckRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HealthcheckRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HealthcheckRequestValidationError) ErrorName() string { + return "HealthcheckRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e HealthcheckRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHealthcheckRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HealthcheckRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HealthcheckRequestValidationError{} + +// Validate checks the field values on HealthcheckResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthcheckResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// HealthcheckResponseValidationError is the validation error returned by +// HealthcheckResponse.Validate if the designated constraints aren't met. +type HealthcheckResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HealthcheckResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HealthcheckResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HealthcheckResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HealthcheckResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HealthcheckResponseValidationError) ErrorName() string { + return "HealthcheckResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e HealthcheckResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHealthcheckResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HealthcheckResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HealthcheckResponseValidationError{} diff --git a/backend/api/k8s/v1/k8s.pb.go b/backend/api/k8s/v1/k8s.pb.go new file mode 100644 index 0000000000..8e86bdc6b5 --- /dev/null +++ b/backend/api/k8s/v1/k8s.pb.go @@ -0,0 +1,2817 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: k8s/v1/k8s.proto + +package k8sv1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + _struct "github.com/golang/protobuf/ptypes/struct" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#containerstate-v1-core +type Container_State int32 + +const ( + Container_UNSPECIFIED Container_State = 0 + Container_UNKNOWN Container_State = 1 + Container_TERMINATED Container_State = 2 + Container_RUNNING Container_State = 3 + Container_WAITING Container_State = 4 +) + +// Enum value maps for Container_State. +var ( + Container_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "TERMINATED", + 3: "RUNNING", + 4: "WAITING", + } + Container_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "TERMINATED": 2, + "RUNNING": 3, + "WAITING": 4, + } +) + +func (x Container_State) Enum() *Container_State { + p := new(Container_State) + *p = x + return p +} + +func (x Container_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Container_State) Descriptor() protoreflect.EnumDescriptor { + return file_k8s_v1_k8s_proto_enumTypes[0].Descriptor() +} + +func (Container_State) Type() protoreflect.EnumType { + return &file_k8s_v1_k8s_proto_enumTypes[0] +} + +func (x Container_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Container_State.Descriptor instead. +func (Container_State) EnumDescriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{2, 0} +} + +// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ +type Pod_State int32 + +const ( + Pod_UNSPECIFIED Pod_State = 0 + Pod_UNKNOWN Pod_State = 1 + Pod_PENDING Pod_State = 2 + Pod_RUNNING Pod_State = 3 + Pod_SUCCEEDED Pod_State = 4 + Pod_FAILED Pod_State = 5 +) + +// Enum value maps for Pod_State. +var ( + Pod_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "PENDING", + 3: "RUNNING", + 4: "SUCCEEDED", + 5: "FAILED", + } + Pod_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "PENDING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + } +) + +func (x Pod_State) Enum() *Pod_State { + p := new(Pod_State) + *p = x + return p +} + +func (x Pod_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Pod_State) Descriptor() protoreflect.EnumDescriptor { + return file_k8s_v1_k8s_proto_enumTypes[1].Descriptor() +} + +func (Pod_State) Type() protoreflect.EnumType { + return &file_k8s_v1_k8s_proto_enumTypes[1] +} + +func (x Pod_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Pod_State.Descriptor instead. +func (Pod_State) EnumDescriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{3, 0} +} + +type DescribePodRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *DescribePodRequest) Reset() { + *x = DescribePodRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DescribePodRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribePodRequest) ProtoMessage() {} + +func (x *DescribePodRequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribePodRequest.ProtoReflect.Descriptor instead. +func (*DescribePodRequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{0} +} + +func (x *DescribePodRequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *DescribePodRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *DescribePodRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *DescribePodRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DescribePodRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type DescribePodResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pod *Pod `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` +} + +func (x *DescribePodResponse) Reset() { + *x = DescribePodResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DescribePodResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribePodResponse) ProtoMessage() {} + +func (x *DescribePodResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribePodResponse.ProtoReflect.Descriptor instead. +func (*DescribePodResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{1} +} + +func (x *DescribePodResponse) GetPod() *Pod { + if x != nil { + return x.Pod + } + return nil +} + +// TODO(maybe): Identify with resource annotations. +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + State Container_State `protobuf:"varint,3,opt,name=state,proto3,enum=clutch.k8s.v1.Container_State" json:"state,omitempty"` + Ready bool `protobuf:"varint,4,opt,name=ready,proto3" json:"ready,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{2} +} + +func (x *Container) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Container) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *Container) GetState() Container_State { + if x != nil { + return x.State + } + return Container_UNSPECIFIED +} + +func (x *Container) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +type Pod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Containers []*Container `protobuf:"bytes,4,rep,name=containers,proto3" json:"containers,omitempty"` + NodeIp string `protobuf:"bytes,5,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"` + PodIp string `protobuf:"bytes,6,opt,name=pod_ip,json=podIp,proto3" json:"pod_ip,omitempty"` + State Pod_State `protobuf:"varint,7,opt,name=state,proto3,enum=clutch.k8s.v1.Pod_State" json:"state,omitempty"` + StartTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,10,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Pod) Reset() { + *x = Pod{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pod) ProtoMessage() {} + +func (x *Pod) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pod.ProtoReflect.Descriptor instead. +func (*Pod) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{3} +} + +func (x *Pod) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *Pod) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Pod) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Pod) GetContainers() []*Container { + if x != nil { + return x.Containers + } + return nil +} + +func (x *Pod) GetNodeIp() string { + if x != nil { + return x.NodeIp + } + return "" +} + +func (x *Pod) GetPodIp() string { + if x != nil { + return x.PodIp + } + return "" +} + +func (x *Pod) GetState() Pod_State { + if x != nil { + return x.State + } + return Pod_UNSPECIFIED +} + +func (x *Pod) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *Pod) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Pod) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type ListOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ListOptions) Reset() { + *x = ListOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListOptions) ProtoMessage() {} + +func (x *ListOptions) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. +func (*ListOptions) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{4} +} + +func (x *ListOptions) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type ListPodsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Options *ListOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *ListPodsRequest) Reset() { + *x = ListPodsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPodsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPodsRequest) ProtoMessage() {} + +func (x *ListPodsRequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPodsRequest.ProtoReflect.Descriptor instead. +func (*ListPodsRequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{5} +} + +func (x *ListPodsRequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *ListPodsRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *ListPodsRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListPodsRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options + } + return nil +} + +type ListPodsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pods []*Pod `protobuf:"bytes,1,rep,name=pods,proto3" json:"pods,omitempty"` +} + +func (x *ListPodsResponse) Reset() { + *x = ListPodsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPodsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPodsResponse) ProtoMessage() {} + +func (x *ListPodsResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPodsResponse.ProtoReflect.Descriptor instead. +func (*ListPodsResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{6} +} + +func (x *ListPodsResponse) GetPods() []*Pod { + if x != nil { + return x.Pods + } + return nil +} + +type DeletePodRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeletePodRequest) Reset() { + *x = DeletePodRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePodRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePodRequest) ProtoMessage() {} + +func (x *DeletePodRequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePodRequest.ProtoReflect.Descriptor instead. +func (*DeletePodRequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{7} +} + +func (x *DeletePodRequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *DeletePodRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *DeletePodRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *DeletePodRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeletePodResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeletePodResponse) Reset() { + *x = DeletePodResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePodResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePodResponse) ProtoMessage() {} + +func (x *DeletePodResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePodResponse.ProtoReflect.Descriptor instead. +func (*DeletePodResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{8} +} + +type UpdatePodRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // Preconditions to check before updating the pod's metadata + // + // Note: An empty StringValue signals that the label/annotation should not be set + ExpectedObjectMetaFields *ExpectedObjectMetaFields `protobuf:"bytes,5,opt,name=expected_object_meta_fields,json=expectedObjectMetaFields,proto3" json:"expected_object_meta_fields,omitempty"` + // Metadata fields to update + ObjectMetaFields *ObjectMetaFields `protobuf:"bytes,6,opt,name=object_meta_fields,json=objectMetaFields,proto3" json:"object_meta_fields,omitempty"` + // Metadata fields to remove + RemoveObjectMetaFields *RemoveObjectMetaFields `protobuf:"bytes,7,opt,name=remove_object_meta_fields,json=removeObjectMetaFields,proto3" json:"remove_object_meta_fields,omitempty"` +} + +func (x *UpdatePodRequest) Reset() { + *x = UpdatePodRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePodRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePodRequest) ProtoMessage() {} + +func (x *UpdatePodRequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePodRequest.ProtoReflect.Descriptor instead. +func (*UpdatePodRequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdatePodRequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *UpdatePodRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *UpdatePodRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *UpdatePodRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdatePodRequest) GetExpectedObjectMetaFields() *ExpectedObjectMetaFields { + if x != nil { + return x.ExpectedObjectMetaFields + } + return nil +} + +func (x *UpdatePodRequest) GetObjectMetaFields() *ObjectMetaFields { + if x != nil { + return x.ObjectMetaFields + } + return nil +} + +func (x *UpdatePodRequest) GetRemoveObjectMetaFields() *RemoveObjectMetaFields { + if x != nil { + return x.RemoveObjectMetaFields + } + return nil +} + +type UpdatePodResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdatePodResponse) Reset() { + *x = UpdatePodResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePodResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePodResponse) ProtoMessage() {} + +func (x *UpdatePodResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePodResponse.ProtoReflect.Descriptor instead. +func (*UpdatePodResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{10} +} + +type HPA struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Sizing *HPA_Sizing `protobuf:"bytes,4,opt,name=sizing,proto3" json:"sizing,omitempty"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *HPA) Reset() { + *x = HPA{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HPA) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HPA) ProtoMessage() {} + +func (x *HPA) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HPA.ProtoReflect.Descriptor instead. +func (*HPA) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{11} +} + +func (x *HPA) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *HPA) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *HPA) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HPA) GetSizing() *HPA_Sizing { + if x != nil { + return x.Sizing + } + return nil +} + +func (x *HPA) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *HPA) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type ResizeHPARequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Sizing *ResizeHPARequest_Sizing `protobuf:"bytes,5,opt,name=sizing,proto3" json:"sizing,omitempty"` +} + +func (x *ResizeHPARequest) Reset() { + *x = ResizeHPARequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeHPARequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeHPARequest) ProtoMessage() {} + +func (x *ResizeHPARequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeHPARequest.ProtoReflect.Descriptor instead. +func (*ResizeHPARequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{12} +} + +func (x *ResizeHPARequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *ResizeHPARequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *ResizeHPARequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ResizeHPARequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ResizeHPARequest) GetSizing() *ResizeHPARequest_Sizing { + if x != nil { + return x.Sizing + } + return nil +} + +type ResizeHPAResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResizeHPAResponse) Reset() { + *x = ResizeHPAResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeHPAResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeHPAResponse) ProtoMessage() {} + +func (x *ResizeHPAResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeHPAResponse.ProtoReflect.Descriptor instead. +func (*ResizeHPAResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{13} +} + +type Deployment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Deployment) Reset() { + *x = Deployment{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{14} +} + +func (x *Deployment) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *Deployment) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Deployment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Deployment) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Deployment) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type UpdateDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clientset string `protobuf:"bytes,1,opt,name=clientset,proto3" json:"clientset,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Fields *UpdateDeploymentRequest_Fields `protobuf:"bytes,5,opt,name=fields,proto3" json:"fields,omitempty"` +} + +func (x *UpdateDeploymentRequest) Reset() { + *x = UpdateDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDeploymentRequest) ProtoMessage() {} + +func (x *UpdateDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDeploymentRequest.ProtoReflect.Descriptor instead. +func (*UpdateDeploymentRequest) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{15} +} + +func (x *UpdateDeploymentRequest) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *UpdateDeploymentRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *UpdateDeploymentRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *UpdateDeploymentRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateDeploymentRequest) GetFields() *UpdateDeploymentRequest_Fields { + if x != nil { + return x.Fields + } + return nil +} + +type UpdateDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateDeploymentResponse) Reset() { + *x = UpdateDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDeploymentResponse) ProtoMessage() {} + +func (x *UpdateDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDeploymentResponse.ProtoReflect.Descriptor instead. +func (*UpdateDeploymentResponse) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{16} +} + +// This message type is used to add support for nullable strings and is an +// alternative to the well-known `StringValue` type. We need it, because the +// grpc-gateway used by Clutch deserializes a null `StringValue` as an empty +// string. +type NullableString struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // *NullableString_Null + // *NullableString_Value + Kind isNullableString_Kind `protobuf_oneof:"kind"` +} + +func (x *NullableString) Reset() { + *x = NullableString{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NullableString) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NullableString) ProtoMessage() {} + +func (x *NullableString) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NullableString.ProtoReflect.Descriptor instead. +func (*NullableString) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{17} +} + +func (m *NullableString) GetKind() isNullableString_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *NullableString) GetNull() _struct.NullValue { + if x, ok := x.GetKind().(*NullableString_Null); ok { + return x.Null + } + return _struct.NullValue_NULL_VALUE +} + +func (x *NullableString) GetValue() string { + if x, ok := x.GetKind().(*NullableString_Value); ok { + return x.Value + } + return "" +} + +type isNullableString_Kind interface { + isNullableString_Kind() +} + +type NullableString_Null struct { + Null _struct.NullValue `protobuf:"varint,1,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"` +} + +type NullableString_Value struct { + Value string `protobuf:"bytes,2,opt,name=value,proto3,oneof"` +} + +func (*NullableString_Null) isNullableString_Kind() {} + +func (*NullableString_Value) isNullableString_Kind() {} + +// Preconditions to check before updating an object's metadata. +// +// Note: A `null` NullableString means that the label/annotation should not be set. +type ExpectedObjectMetaFields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels map[string]*NullableString `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]*NullableString `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ExpectedObjectMetaFields) Reset() { + *x = ExpectedObjectMetaFields{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExpectedObjectMetaFields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExpectedObjectMetaFields) ProtoMessage() {} + +func (x *ExpectedObjectMetaFields) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExpectedObjectMetaFields.ProtoReflect.Descriptor instead. +func (*ExpectedObjectMetaFields) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{18} +} + +func (x *ExpectedObjectMetaFields) GetLabels() map[string]*NullableString { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ExpectedObjectMetaFields) GetAnnotations() map[string]*NullableString { + if x != nil { + return x.Annotations + } + return nil +} + +// Metadata fields to update when updating an object +type ObjectMetaFields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ObjectMetaFields) Reset() { + *x = ObjectMetaFields{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectMetaFields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectMetaFields) ProtoMessage() {} + +func (x *ObjectMetaFields) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectMetaFields.ProtoReflect.Descriptor instead. +func (*ObjectMetaFields) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{19} +} + +func (x *ObjectMetaFields) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ObjectMetaFields) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +// Metadata fields to remove when updating an object +type RemoveObjectMetaFields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels []string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Annotations []string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` +} + +func (x *RemoveObjectMetaFields) Reset() { + *x = RemoveObjectMetaFields{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveObjectMetaFields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveObjectMetaFields) ProtoMessage() {} + +func (x *RemoveObjectMetaFields) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveObjectMetaFields.ProtoReflect.Descriptor instead. +func (*RemoveObjectMetaFields) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{20} +} + +func (x *RemoveObjectMetaFields) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *RemoveObjectMetaFields) GetAnnotations() []string { + if x != nil { + return x.Annotations + } + return nil +} + +type HPA_Sizing struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinReplicas uint32 `protobuf:"varint,1,opt,name=min_replicas,json=minReplicas,proto3" json:"min_replicas,omitempty"` + MaxReplicas uint32 `protobuf:"varint,2,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + CurrentReplicas uint32 `protobuf:"varint,3,opt,name=current_replicas,json=currentReplicas,proto3" json:"current_replicas,omitempty"` + DesiredReplicas uint32 `protobuf:"varint,4,opt,name=desired_replicas,json=desiredReplicas,proto3" json:"desired_replicas,omitempty"` +} + +func (x *HPA_Sizing) Reset() { + *x = HPA_Sizing{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HPA_Sizing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HPA_Sizing) ProtoMessage() {} + +func (x *HPA_Sizing) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HPA_Sizing.ProtoReflect.Descriptor instead. +func (*HPA_Sizing) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *HPA_Sizing) GetMinReplicas() uint32 { + if x != nil { + return x.MinReplicas + } + return 0 +} + +func (x *HPA_Sizing) GetMaxReplicas() uint32 { + if x != nil { + return x.MaxReplicas + } + return 0 +} + +func (x *HPA_Sizing) GetCurrentReplicas() uint32 { + if x != nil { + return x.CurrentReplicas + } + return 0 +} + +func (x *HPA_Sizing) GetDesiredReplicas() uint32 { + if x != nil { + return x.DesiredReplicas + } + return 0 +} + +type ResizeHPARequest_Sizing struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Min uint32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"` + Max uint32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"` +} + +func (x *ResizeHPARequest_Sizing) Reset() { + *x = ResizeHPARequest_Sizing{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeHPARequest_Sizing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeHPARequest_Sizing) ProtoMessage() {} + +func (x *ResizeHPARequest_Sizing) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeHPARequest_Sizing.ProtoReflect.Descriptor instead. +func (*ResizeHPARequest_Sizing) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *ResizeHPARequest_Sizing) GetMin() uint32 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *ResizeHPARequest_Sizing) GetMax() uint32 { + if x != nil { + return x.Max + } + return 0 +} + +// Fields are merged with the existing deployment object, existing +// labels and annotations are not deleted in the update process. +// Currently this api does not support removing Fields from the deployment object. +// A two way strategic merge is done on the old and new deployment objects. +// https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment +type UpdateDeploymentRequest_Fields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *UpdateDeploymentRequest_Fields) Reset() { + *x = UpdateDeploymentRequest_Fields{} + if protoimpl.UnsafeEnabled { + mi := &file_k8s_v1_k8s_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDeploymentRequest_Fields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDeploymentRequest_Fields) ProtoMessage() {} + +func (x *UpdateDeploymentRequest_Fields) ProtoReflect() protoreflect.Message { + mi := &file_k8s_v1_k8s_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDeploymentRequest_Fields.ProtoReflect.Descriptor instead. +func (*UpdateDeploymentRequest_Fields) Descriptor() ([]byte, []int) { + return file_k8s_v1_k8s_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *UpdateDeploymentRequest_Fields) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *UpdateDeploymentRequest_Fields) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +var File_k8s_v1_k8s_proto protoreflect.FileDescriptor + +var file_k8s_v1_k8s_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x6b, 0x38, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, + 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xeb, 0x02, 0x0a, 0x12, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x6f, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, + 0x21, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x25, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, + 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x37, 0xb2, 0xe1, 0x1c, 0x33, 0x0a, 0x31, 0x0a, 0x11, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, + 0x64, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, + 0x46, 0x0a, 0x13, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x3a, 0x09, 0xaa, 0xe1, + 0x1c, 0x05, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x22, 0xd2, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, + 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22, 0x4f, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x44, + 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, + 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x22, 0xb5, 0x05, 0x0a, + 0x03, 0x50, 0x6f, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x70, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x6f, 0x64, 0x5f, 0x69, 0x70, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, 0x64, 0x49, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, + 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x45, 0x0a, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x5a, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, + 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x04, 0x12, + 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x3a, 0x37, 0xb2, 0xe1, 0x1c, + 0x33, 0x0a, 0x31, 0x0a, 0x11, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x88, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xc2, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, + 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x46, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x3a, 0x0a, 0xaa, 0xe1, 0x1c, 0x06, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x22, 0xd9, 0x01, 0x0a, + 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x20, 0x01, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, + 0x37, 0xb2, 0xe1, 0x1c, 0x33, 0x0a, 0x31, 0x0a, 0x11, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf2, 0x03, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x25, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x66, 0x0a, 0x1b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, + 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, 0x18, + 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4d, 0x0a, 0x12, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x60, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x3a, 0x37, 0xb2, 0xe1, 0x1c, 0x33, 0x0a, + 0x31, 0x0a, 0x11, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x6f, 0x64, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xde, 0x04, 0x0a, 0x03, 0x48, 0x50, 0x41, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, + 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x50, 0x41, 0x2e, + 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x12, 0x36, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, + 0x50, 0x41, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x50, 0x41, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xa4, 0x01, + 0x0a, 0x06, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x5f, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, + 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, + 0x61, 0x78, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x29, + 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, + 0x69, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, + 0x37, 0xb2, 0xe1, 0x1c, 0x33, 0x0a, 0x31, 0x0a, 0x11, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x50, 0x41, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, 0xd1, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x73, + 0x69, 0x7a, 0x65, 0x48, 0x50, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1b, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x06, 0x73, + 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, + 0x7a, 0x65, 0x48, 0x50, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x69, 0x7a, + 0x69, 0x6e, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, + 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x1a, 0x2c, 0x0a, 0x06, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6d, 0x69, + 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, + 0x6d, 0x61, 0x78, 0x3a, 0x37, 0xb2, 0xe1, 0x1c, 0x33, 0x0a, 0x31, 0x0a, 0x11, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x50, 0x41, 0x12, 0x1c, + 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x13, 0x0a, 0x11, + 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x48, 0x50, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xa0, 0x03, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x4c, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x3e, 0xb2, 0xe1, 0x1c, 0x3a, 0x0a, 0x38, 0x0a, 0x18, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x8f, 0x05, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x25, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, + 0x01, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, + 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, + 0xd4, 0x02, 0x0a, 0x06, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x5f, 0x0a, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x6e, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x3e, 0xb2, 0xe1, 0x1c, 0x3a, 0x0a, 0x38, 0x0a, 0x18, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x7b, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x7d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x62, 0x0a, 0x0e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, + 0x52, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x98, 0x03, 0x0a, 0x18, 0x45, 0x78, 0x70, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x12, 0x59, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, + 0x22, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x68, + 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x41, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xfa, + 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x58, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x5d, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xc2, 0x02, 0x0a, 0x10, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x51, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, 0x02, 0x20, + 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x60, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x9a, 0x01, 0x06, 0x22, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x66, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x12, 0x20, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x18, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x12, 0x2a, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x18, + 0x01, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xe1, + 0x05, 0x0a, 0x06, 0x4b, 0x38, 0x73, 0x41, 0x50, 0x49, 0x12, 0x7a, 0x0a, 0x0b, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, + 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, + 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x6f, 0x64, 0x3a, 0x01, 0x2a, 0xaa, + 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0x6e, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, + 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, + 0x6b, 0x38, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0xaa, + 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0x72, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x6f, 0x64, 0x12, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, + 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, + 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x04, 0x12, 0x72, 0x0a, 0x09, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x16, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x6f, 0x64, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x03, 0x12, 0x72, 0x0a, + 0x09, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x48, 0x50, 0x41, 0x12, 0x1f, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, + 0x65, 0x48, 0x50, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, + 0x7a, 0x65, 0x48, 0x50, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x72, + 0x65, 0x73, 0x69, 0x7a, 0x65, 0x48, 0x50, 0x41, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, + 0x03, 0x12, 0x8e, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, + 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, + 0x08, 0x03, 0x42, 0x07, 0x5a, 0x05, 0x6b, 0x38, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_k8s_v1_k8s_proto_rawDescOnce sync.Once + file_k8s_v1_k8s_proto_rawDescData = file_k8s_v1_k8s_proto_rawDesc +) + +func file_k8s_v1_k8s_proto_rawDescGZIP() []byte { + file_k8s_v1_k8s_proto_rawDescOnce.Do(func() { + file_k8s_v1_k8s_proto_rawDescData = protoimpl.X.CompressGZIP(file_k8s_v1_k8s_proto_rawDescData) + }) + return file_k8s_v1_k8s_proto_rawDescData +} + +var file_k8s_v1_k8s_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_k8s_v1_k8s_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_k8s_v1_k8s_proto_goTypes = []interface{}{ + (Container_State)(0), // 0: clutch.k8s.v1.Container.State + (Pod_State)(0), // 1: clutch.k8s.v1.Pod.State + (*DescribePodRequest)(nil), // 2: clutch.k8s.v1.DescribePodRequest + (*DescribePodResponse)(nil), // 3: clutch.k8s.v1.DescribePodResponse + (*Container)(nil), // 4: clutch.k8s.v1.Container + (*Pod)(nil), // 5: clutch.k8s.v1.Pod + (*ListOptions)(nil), // 6: clutch.k8s.v1.ListOptions + (*ListPodsRequest)(nil), // 7: clutch.k8s.v1.ListPodsRequest + (*ListPodsResponse)(nil), // 8: clutch.k8s.v1.ListPodsResponse + (*DeletePodRequest)(nil), // 9: clutch.k8s.v1.DeletePodRequest + (*DeletePodResponse)(nil), // 10: clutch.k8s.v1.DeletePodResponse + (*UpdatePodRequest)(nil), // 11: clutch.k8s.v1.UpdatePodRequest + (*UpdatePodResponse)(nil), // 12: clutch.k8s.v1.UpdatePodResponse + (*HPA)(nil), // 13: clutch.k8s.v1.HPA + (*ResizeHPARequest)(nil), // 14: clutch.k8s.v1.ResizeHPARequest + (*ResizeHPAResponse)(nil), // 15: clutch.k8s.v1.ResizeHPAResponse + (*Deployment)(nil), // 16: clutch.k8s.v1.Deployment + (*UpdateDeploymentRequest)(nil), // 17: clutch.k8s.v1.UpdateDeploymentRequest + (*UpdateDeploymentResponse)(nil), // 18: clutch.k8s.v1.UpdateDeploymentResponse + (*NullableString)(nil), // 19: clutch.k8s.v1.NullableString + (*ExpectedObjectMetaFields)(nil), // 20: clutch.k8s.v1.ExpectedObjectMetaFields + (*ObjectMetaFields)(nil), // 21: clutch.k8s.v1.ObjectMetaFields + (*RemoveObjectMetaFields)(nil), // 22: clutch.k8s.v1.RemoveObjectMetaFields + nil, // 23: clutch.k8s.v1.DescribePodRequest.LabelsEntry + nil, // 24: clutch.k8s.v1.Pod.LabelsEntry + nil, // 25: clutch.k8s.v1.Pod.AnnotationsEntry + nil, // 26: clutch.k8s.v1.ListOptions.LabelsEntry + (*HPA_Sizing)(nil), // 27: clutch.k8s.v1.HPA.Sizing + nil, // 28: clutch.k8s.v1.HPA.LabelsEntry + nil, // 29: clutch.k8s.v1.HPA.AnnotationsEntry + (*ResizeHPARequest_Sizing)(nil), // 30: clutch.k8s.v1.ResizeHPARequest.Sizing + nil, // 31: clutch.k8s.v1.Deployment.LabelsEntry + nil, // 32: clutch.k8s.v1.Deployment.AnnotationsEntry + (*UpdateDeploymentRequest_Fields)(nil), // 33: clutch.k8s.v1.UpdateDeploymentRequest.Fields + nil, // 34: clutch.k8s.v1.UpdateDeploymentRequest.Fields.LabelsEntry + nil, // 35: clutch.k8s.v1.UpdateDeploymentRequest.Fields.AnnotationsEntry + nil, // 36: clutch.k8s.v1.ExpectedObjectMetaFields.LabelsEntry + nil, // 37: clutch.k8s.v1.ExpectedObjectMetaFields.AnnotationsEntry + nil, // 38: clutch.k8s.v1.ObjectMetaFields.LabelsEntry + nil, // 39: clutch.k8s.v1.ObjectMetaFields.AnnotationsEntry + (*timestamp.Timestamp)(nil), // 40: google.protobuf.Timestamp + (_struct.NullValue)(0), // 41: google.protobuf.NullValue +} +var file_k8s_v1_k8s_proto_depIdxs = []int32{ + 23, // 0: clutch.k8s.v1.DescribePodRequest.labels:type_name -> clutch.k8s.v1.DescribePodRequest.LabelsEntry + 5, // 1: clutch.k8s.v1.DescribePodResponse.pod:type_name -> clutch.k8s.v1.Pod + 0, // 2: clutch.k8s.v1.Container.state:type_name -> clutch.k8s.v1.Container.State + 4, // 3: clutch.k8s.v1.Pod.containers:type_name -> clutch.k8s.v1.Container + 1, // 4: clutch.k8s.v1.Pod.state:type_name -> clutch.k8s.v1.Pod.State + 40, // 5: clutch.k8s.v1.Pod.start_time:type_name -> google.protobuf.Timestamp + 24, // 6: clutch.k8s.v1.Pod.labels:type_name -> clutch.k8s.v1.Pod.LabelsEntry + 25, // 7: clutch.k8s.v1.Pod.annotations:type_name -> clutch.k8s.v1.Pod.AnnotationsEntry + 26, // 8: clutch.k8s.v1.ListOptions.labels:type_name -> clutch.k8s.v1.ListOptions.LabelsEntry + 6, // 9: clutch.k8s.v1.ListPodsRequest.options:type_name -> clutch.k8s.v1.ListOptions + 5, // 10: clutch.k8s.v1.ListPodsResponse.pods:type_name -> clutch.k8s.v1.Pod + 20, // 11: clutch.k8s.v1.UpdatePodRequest.expected_object_meta_fields:type_name -> clutch.k8s.v1.ExpectedObjectMetaFields + 21, // 12: clutch.k8s.v1.UpdatePodRequest.object_meta_fields:type_name -> clutch.k8s.v1.ObjectMetaFields + 22, // 13: clutch.k8s.v1.UpdatePodRequest.remove_object_meta_fields:type_name -> clutch.k8s.v1.RemoveObjectMetaFields + 27, // 14: clutch.k8s.v1.HPA.sizing:type_name -> clutch.k8s.v1.HPA.Sizing + 28, // 15: clutch.k8s.v1.HPA.labels:type_name -> clutch.k8s.v1.HPA.LabelsEntry + 29, // 16: clutch.k8s.v1.HPA.annotations:type_name -> clutch.k8s.v1.HPA.AnnotationsEntry + 30, // 17: clutch.k8s.v1.ResizeHPARequest.sizing:type_name -> clutch.k8s.v1.ResizeHPARequest.Sizing + 31, // 18: clutch.k8s.v1.Deployment.labels:type_name -> clutch.k8s.v1.Deployment.LabelsEntry + 32, // 19: clutch.k8s.v1.Deployment.annotations:type_name -> clutch.k8s.v1.Deployment.AnnotationsEntry + 33, // 20: clutch.k8s.v1.UpdateDeploymentRequest.fields:type_name -> clutch.k8s.v1.UpdateDeploymentRequest.Fields + 41, // 21: clutch.k8s.v1.NullableString.null:type_name -> google.protobuf.NullValue + 36, // 22: clutch.k8s.v1.ExpectedObjectMetaFields.labels:type_name -> clutch.k8s.v1.ExpectedObjectMetaFields.LabelsEntry + 37, // 23: clutch.k8s.v1.ExpectedObjectMetaFields.annotations:type_name -> clutch.k8s.v1.ExpectedObjectMetaFields.AnnotationsEntry + 38, // 24: clutch.k8s.v1.ObjectMetaFields.labels:type_name -> clutch.k8s.v1.ObjectMetaFields.LabelsEntry + 39, // 25: clutch.k8s.v1.ObjectMetaFields.annotations:type_name -> clutch.k8s.v1.ObjectMetaFields.AnnotationsEntry + 34, // 26: clutch.k8s.v1.UpdateDeploymentRequest.Fields.labels:type_name -> clutch.k8s.v1.UpdateDeploymentRequest.Fields.LabelsEntry + 35, // 27: clutch.k8s.v1.UpdateDeploymentRequest.Fields.annotations:type_name -> clutch.k8s.v1.UpdateDeploymentRequest.Fields.AnnotationsEntry + 19, // 28: clutch.k8s.v1.ExpectedObjectMetaFields.LabelsEntry.value:type_name -> clutch.k8s.v1.NullableString + 19, // 29: clutch.k8s.v1.ExpectedObjectMetaFields.AnnotationsEntry.value:type_name -> clutch.k8s.v1.NullableString + 2, // 30: clutch.k8s.v1.K8sAPI.DescribePod:input_type -> clutch.k8s.v1.DescribePodRequest + 7, // 31: clutch.k8s.v1.K8sAPI.ListPods:input_type -> clutch.k8s.v1.ListPodsRequest + 9, // 32: clutch.k8s.v1.K8sAPI.DeletePod:input_type -> clutch.k8s.v1.DeletePodRequest + 11, // 33: clutch.k8s.v1.K8sAPI.UpdatePod:input_type -> clutch.k8s.v1.UpdatePodRequest + 14, // 34: clutch.k8s.v1.K8sAPI.ResizeHPA:input_type -> clutch.k8s.v1.ResizeHPARequest + 17, // 35: clutch.k8s.v1.K8sAPI.UpdateDeployment:input_type -> clutch.k8s.v1.UpdateDeploymentRequest + 3, // 36: clutch.k8s.v1.K8sAPI.DescribePod:output_type -> clutch.k8s.v1.DescribePodResponse + 8, // 37: clutch.k8s.v1.K8sAPI.ListPods:output_type -> clutch.k8s.v1.ListPodsResponse + 10, // 38: clutch.k8s.v1.K8sAPI.DeletePod:output_type -> clutch.k8s.v1.DeletePodResponse + 12, // 39: clutch.k8s.v1.K8sAPI.UpdatePod:output_type -> clutch.k8s.v1.UpdatePodResponse + 15, // 40: clutch.k8s.v1.K8sAPI.ResizeHPA:output_type -> clutch.k8s.v1.ResizeHPAResponse + 18, // 41: clutch.k8s.v1.K8sAPI.UpdateDeployment:output_type -> clutch.k8s.v1.UpdateDeploymentResponse + 36, // [36:42] is the sub-list for method output_type + 30, // [30:36] is the sub-list for method input_type + 30, // [30:30] is the sub-list for extension type_name + 30, // [30:30] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name +} + +func init() { file_k8s_v1_k8s_proto_init() } +func file_k8s_v1_k8s_proto_init() { + if File_k8s_v1_k8s_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_k8s_v1_k8s_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DescribePodRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DescribePodResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPodsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPodsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePodRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePodResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePodRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePodResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HPA); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeHPARequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeHPAResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Deployment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NullableString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExpectedObjectMetaFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectMetaFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveObjectMetaFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HPA_Sizing); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeHPARequest_Sizing); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_k8s_v1_k8s_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeploymentRequest_Fields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_k8s_v1_k8s_proto_msgTypes[17].OneofWrappers = []interface{}{ + (*NullableString_Null)(nil), + (*NullableString_Value)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_k8s_v1_k8s_proto_rawDesc, + NumEnums: 2, + NumMessages: 38, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_k8s_v1_k8s_proto_goTypes, + DependencyIndexes: file_k8s_v1_k8s_proto_depIdxs, + EnumInfos: file_k8s_v1_k8s_proto_enumTypes, + MessageInfos: file_k8s_v1_k8s_proto_msgTypes, + }.Build() + File_k8s_v1_k8s_proto = out.File + file_k8s_v1_k8s_proto_rawDesc = nil + file_k8s_v1_k8s_proto_goTypes = nil + file_k8s_v1_k8s_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// K8SAPIClient is the client API for K8SAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type K8SAPIClient interface { + DescribePod(ctx context.Context, in *DescribePodRequest, opts ...grpc.CallOption) (*DescribePodResponse, error) + ListPods(ctx context.Context, in *ListPodsRequest, opts ...grpc.CallOption) (*ListPodsResponse, error) + DeletePod(ctx context.Context, in *DeletePodRequest, opts ...grpc.CallOption) (*DeletePodResponse, error) + UpdatePod(ctx context.Context, in *UpdatePodRequest, opts ...grpc.CallOption) (*UpdatePodResponse, error) + ResizeHPA(ctx context.Context, in *ResizeHPARequest, opts ...grpc.CallOption) (*ResizeHPAResponse, error) + UpdateDeployment(ctx context.Context, in *UpdateDeploymentRequest, opts ...grpc.CallOption) (*UpdateDeploymentResponse, error) +} + +type k8SAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewK8SAPIClient(cc grpc.ClientConnInterface) K8SAPIClient { + return &k8SAPIClient{cc} +} + +func (c *k8SAPIClient) DescribePod(ctx context.Context, in *DescribePodRequest, opts ...grpc.CallOption) (*DescribePodResponse, error) { + out := new(DescribePodResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/DescribePod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *k8SAPIClient) ListPods(ctx context.Context, in *ListPodsRequest, opts ...grpc.CallOption) (*ListPodsResponse, error) { + out := new(ListPodsResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/ListPods", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *k8SAPIClient) DeletePod(ctx context.Context, in *DeletePodRequest, opts ...grpc.CallOption) (*DeletePodResponse, error) { + out := new(DeletePodResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/DeletePod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *k8SAPIClient) UpdatePod(ctx context.Context, in *UpdatePodRequest, opts ...grpc.CallOption) (*UpdatePodResponse, error) { + out := new(UpdatePodResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/UpdatePod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *k8SAPIClient) ResizeHPA(ctx context.Context, in *ResizeHPARequest, opts ...grpc.CallOption) (*ResizeHPAResponse, error) { + out := new(ResizeHPAResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/ResizeHPA", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *k8SAPIClient) UpdateDeployment(ctx context.Context, in *UpdateDeploymentRequest, opts ...grpc.CallOption) (*UpdateDeploymentResponse, error) { + out := new(UpdateDeploymentResponse) + err := c.cc.Invoke(ctx, "/clutch.k8s.v1.K8sAPI/UpdateDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// K8SAPIServer is the server API for K8SAPI service. +type K8SAPIServer interface { + DescribePod(context.Context, *DescribePodRequest) (*DescribePodResponse, error) + ListPods(context.Context, *ListPodsRequest) (*ListPodsResponse, error) + DeletePod(context.Context, *DeletePodRequest) (*DeletePodResponse, error) + UpdatePod(context.Context, *UpdatePodRequest) (*UpdatePodResponse, error) + ResizeHPA(context.Context, *ResizeHPARequest) (*ResizeHPAResponse, error) + UpdateDeployment(context.Context, *UpdateDeploymentRequest) (*UpdateDeploymentResponse, error) +} + +// UnimplementedK8SAPIServer can be embedded to have forward compatible implementations. +type UnimplementedK8SAPIServer struct { +} + +func (*UnimplementedK8SAPIServer) DescribePod(context.Context, *DescribePodRequest) (*DescribePodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribePod not implemented") +} +func (*UnimplementedK8SAPIServer) ListPods(context.Context, *ListPodsRequest) (*ListPodsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPods not implemented") +} +func (*UnimplementedK8SAPIServer) DeletePod(context.Context, *DeletePodRequest) (*DeletePodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePod not implemented") +} +func (*UnimplementedK8SAPIServer) UpdatePod(context.Context, *UpdatePodRequest) (*UpdatePodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePod not implemented") +} +func (*UnimplementedK8SAPIServer) ResizeHPA(context.Context, *ResizeHPARequest) (*ResizeHPAResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResizeHPA not implemented") +} +func (*UnimplementedK8SAPIServer) UpdateDeployment(context.Context, *UpdateDeploymentRequest) (*UpdateDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDeployment not implemented") +} + +func RegisterK8SAPIServer(s *grpc.Server, srv K8SAPIServer) { + s.RegisterService(&_K8SAPI_serviceDesc, srv) +} + +func _K8SAPI_DescribePod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribePodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).DescribePod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/DescribePod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).DescribePod(ctx, req.(*DescribePodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _K8SAPI_ListPods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPodsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).ListPods(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/ListPods", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).ListPods(ctx, req.(*ListPodsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _K8SAPI_DeletePod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).DeletePod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/DeletePod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).DeletePod(ctx, req.(*DeletePodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _K8SAPI_UpdatePod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).UpdatePod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/UpdatePod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).UpdatePod(ctx, req.(*UpdatePodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _K8SAPI_ResizeHPA_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResizeHPARequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).ResizeHPA(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/ResizeHPA", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).ResizeHPA(ctx, req.(*ResizeHPARequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _K8SAPI_UpdateDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(K8SAPIServer).UpdateDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.k8s.v1.K8sAPI/UpdateDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(K8SAPIServer).UpdateDeployment(ctx, req.(*UpdateDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _K8SAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.k8s.v1.K8sAPI", + HandlerType: (*K8SAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DescribePod", + Handler: _K8SAPI_DescribePod_Handler, + }, + { + MethodName: "ListPods", + Handler: _K8SAPI_ListPods_Handler, + }, + { + MethodName: "DeletePod", + Handler: _K8SAPI_DeletePod_Handler, + }, + { + MethodName: "UpdatePod", + Handler: _K8SAPI_UpdatePod_Handler, + }, + { + MethodName: "ResizeHPA", + Handler: _K8SAPI_ResizeHPA_Handler, + }, + { + MethodName: "UpdateDeployment", + Handler: _K8SAPI_UpdateDeployment_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "k8s/v1/k8s.proto", +} diff --git a/backend/api/k8s/v1/k8s.pb.gw.go b/backend/api/k8s/v1/k8s.pb.gw.go new file mode 100644 index 0000000000..594fa9b60a --- /dev/null +++ b/backend/api/k8s/v1/k8s.pb.gw.go @@ -0,0 +1,572 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: k8s/v1/k8s.proto + +/* +Package k8sv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package k8sv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_K8SAPI_DescribePod_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DescribePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DescribePod(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_DescribePod_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DescribePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DescribePod(ctx, &protoReq) + return msg, metadata, err + +} + +func request_K8SAPI_ListPods_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPodsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListPods(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_ListPods_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPodsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListPods(ctx, &protoReq) + return msg, metadata, err + +} + +func request_K8SAPI_DeletePod_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeletePod(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_DeletePod_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeletePod(ctx, &protoReq) + return msg, metadata, err + +} + +func request_K8SAPI_UpdatePod_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdatePod(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_UpdatePod_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePodRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdatePod(ctx, &protoReq) + return msg, metadata, err + +} + +func request_K8SAPI_ResizeHPA_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResizeHPARequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ResizeHPA(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_ResizeHPA_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResizeHPARequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ResizeHPA(ctx, &protoReq) + return msg, metadata, err + +} + +func request_K8SAPI_UpdateDeployment_0(ctx context.Context, marshaler runtime.Marshaler, client K8SAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateDeploymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateDeployment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_K8SAPI_UpdateDeployment_0(ctx context.Context, marshaler runtime.Marshaler, server K8SAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateDeploymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateDeployment(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterK8SAPIHandlerServer registers the http handlers for service K8SAPI to "mux". +// UnaryRPC :call K8SAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterK8SAPIHandlerFromEndpoint instead. +func RegisterK8SAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server K8SAPIServer) error { + + mux.Handle("POST", pattern_K8SAPI_DescribePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/DescribePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_DescribePod_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_DescribePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_ListPods_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/ListPods") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_ListPods_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_ListPods_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_DeletePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/DeletePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_DeletePod_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_DeletePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_UpdatePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/UpdatePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_UpdatePod_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_UpdatePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_ResizeHPA_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/ResizeHPA") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_ResizeHPA_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_ResizeHPA_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_UpdateDeployment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/UpdateDeployment") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_K8SAPI_UpdateDeployment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_UpdateDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterK8SAPIHandlerFromEndpoint is same as RegisterK8SAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterK8SAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterK8SAPIHandler(ctx, mux, conn) +} + +// RegisterK8SAPIHandler registers the http handlers for service K8SAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterK8SAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterK8SAPIHandlerClient(ctx, mux, NewK8SAPIClient(conn)) +} + +// RegisterK8SAPIHandlerClient registers the http handlers for service K8SAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "K8SAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "K8SAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "K8SAPIClient" to call the correct interceptors. +func RegisterK8SAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client K8SAPIClient) error { + + mux.Handle("POST", pattern_K8SAPI_DescribePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/DescribePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_DescribePod_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_DescribePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_ListPods_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/ListPods") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_ListPods_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_ListPods_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_DeletePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/DeletePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_DeletePod_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_DeletePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_UpdatePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/UpdatePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_UpdatePod_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_UpdatePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_ResizeHPA_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/ResizeHPA") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_ResizeHPA_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_ResizeHPA_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_K8SAPI_UpdateDeployment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.k8s.v1.K8SAPI/UpdateDeployment") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_K8SAPI_UpdateDeployment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_K8SAPI_UpdateDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_K8SAPI_DescribePod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "describePod"}, "")) + + pattern_K8SAPI_ListPods_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "listPods"}, "")) + + pattern_K8SAPI_DeletePod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "deletePod"}, "")) + + pattern_K8SAPI_UpdatePod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "updatePod"}, "")) + + pattern_K8SAPI_ResizeHPA_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "resizeHPA"}, "")) + + pattern_K8SAPI_UpdateDeployment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "k8s", "updateDeployment"}, "")) +) + +var ( + forward_K8SAPI_DescribePod_0 = runtime.ForwardResponseMessage + + forward_K8SAPI_ListPods_0 = runtime.ForwardResponseMessage + + forward_K8SAPI_DeletePod_0 = runtime.ForwardResponseMessage + + forward_K8SAPI_UpdatePod_0 = runtime.ForwardResponseMessage + + forward_K8SAPI_ResizeHPA_0 = runtime.ForwardResponseMessage + + forward_K8SAPI_UpdateDeployment_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/k8s/v1/k8s.pb.validate.go b/backend/api/k8s/v1/k8s.pb.validate.go new file mode 100644 index 0000000000..c5cd4584f8 --- /dev/null +++ b/backend/api/k8s/v1/k8s.pb.validate.go @@ -0,0 +1,2132 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: k8s/v1/k8s.proto + +package k8sv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" + + structpb "github.com/golang/protobuf/ptypes/struct" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} + + _ = structpb.NullValue(0) +) + +// define the regex for a UUID once up-front +var _k_8_s_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on DescribePodRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DescribePodRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return DescribePodRequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return DescribePodRequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return DescribePodRequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return DescribePodRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + for key, val := range m.GetLabels() { + _ = val + + if len(key) < 1 { + return DescribePodRequestValidationError{ + field: fmt.Sprintf("Labels[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Labels[key] + } + + return nil +} + +// DescribePodRequestValidationError is the validation error returned by +// DescribePodRequest.Validate if the designated constraints aren't met. +type DescribePodRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DescribePodRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DescribePodRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DescribePodRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DescribePodRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DescribePodRequestValidationError) ErrorName() string { + return "DescribePodRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DescribePodRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDescribePodRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DescribePodRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DescribePodRequestValidationError{} + +// Validate checks the field values on DescribePodResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DescribePodResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetPod()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DescribePodResponseValidationError{ + field: "Pod", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// DescribePodResponseValidationError is the validation error returned by +// DescribePodResponse.Validate if the designated constraints aren't met. +type DescribePodResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DescribePodResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DescribePodResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DescribePodResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DescribePodResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DescribePodResponseValidationError) ErrorName() string { + return "DescribePodResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DescribePodResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDescribePodResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DescribePodResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DescribePodResponseValidationError{} + +// Validate checks the field values on Container with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Container) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Image + + // no validation rules for State + + // no validation rules for Ready + + return nil +} + +// ContainerValidationError is the validation error returned by +// Container.Validate if the designated constraints aren't met. +type ContainerValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ContainerValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ContainerValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ContainerValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ContainerValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ContainerValidationError) ErrorName() string { return "ContainerValidationError" } + +// Error satisfies the builtin error interface +func (e ContainerValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sContainer.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ContainerValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ContainerValidationError{} + +// Validate checks the field values on Pod with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Pod) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Cluster + + // no validation rules for Namespace + + // no validation rules for Name + + for idx, item := range m.GetContainers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PodValidationError{ + field: fmt.Sprintf("Containers[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for NodeIp + + // no validation rules for PodIp + + // no validation rules for State + + if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PodValidationError{ + field: "StartTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Labels + + // no validation rules for Annotations + + return nil +} + +// PodValidationError is the validation error returned by Pod.Validate if the +// designated constraints aren't met. +type PodValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PodValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PodValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PodValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PodValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PodValidationError) ErrorName() string { return "PodValidationError" } + +// Error satisfies the builtin error interface +func (e PodValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPod.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PodValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PodValidationError{} + +// Validate checks the field values on ListOptions with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ListOptions) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Labels + + return nil +} + +// ListOptionsValidationError is the validation error returned by +// ListOptions.Validate if the designated constraints aren't met. +type ListOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListOptionsValidationError) ErrorName() string { return "ListOptionsValidationError" } + +// Error satisfies the builtin error interface +func (e ListOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListOptionsValidationError{} + +// Validate checks the field values on ListPodsRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ListPodsRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return ListPodsRequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return ListPodsRequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return ListPodsRequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetOptions() == nil { + return ListPodsRequestValidationError{ + field: "Options", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListPodsRequestValidationError{ + field: "Options", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ListPodsRequestValidationError is the validation error returned by +// ListPodsRequest.Validate if the designated constraints aren't met. +type ListPodsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListPodsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListPodsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListPodsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListPodsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListPodsRequestValidationError) ErrorName() string { return "ListPodsRequestValidationError" } + +// Error satisfies the builtin error interface +func (e ListPodsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListPodsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListPodsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListPodsRequestValidationError{} + +// Validate checks the field values on ListPodsResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ListPodsResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetPods() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListPodsResponseValidationError{ + field: fmt.Sprintf("Pods[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ListPodsResponseValidationError is the validation error returned by +// ListPodsResponse.Validate if the designated constraints aren't met. +type ListPodsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListPodsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListPodsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListPodsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListPodsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListPodsResponseValidationError) ErrorName() string { return "ListPodsResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ListPodsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sListPodsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListPodsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListPodsResponseValidationError{} + +// Validate checks the field values on DeletePodRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *DeletePodRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return DeletePodRequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return DeletePodRequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return DeletePodRequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return DeletePodRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// DeletePodRequestValidationError is the validation error returned by +// DeletePodRequest.Validate if the designated constraints aren't met. +type DeletePodRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeletePodRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeletePodRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeletePodRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeletePodRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeletePodRequestValidationError) ErrorName() string { return "DeletePodRequestValidationError" } + +// Error satisfies the builtin error interface +func (e DeletePodRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeletePodRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeletePodRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeletePodRequestValidationError{} + +// Validate checks the field values on DeletePodResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *DeletePodResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// DeletePodResponseValidationError is the validation error returned by +// DeletePodResponse.Validate if the designated constraints aren't met. +type DeletePodResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeletePodResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeletePodResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeletePodResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeletePodResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeletePodResponseValidationError) ErrorName() string { + return "DeletePodResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DeletePodResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeletePodResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeletePodResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeletePodResponseValidationError{} + +// Validate checks the field values on UpdatePodRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *UpdatePodRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return UpdatePodRequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return UpdatePodRequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return UpdatePodRequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return UpdatePodRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetExpectedObjectMetaFields()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdatePodRequestValidationError{ + field: "ExpectedObjectMetaFields", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetObjectMetaFields()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdatePodRequestValidationError{ + field: "ObjectMetaFields", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetRemoveObjectMetaFields()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdatePodRequestValidationError{ + field: "RemoveObjectMetaFields", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// UpdatePodRequestValidationError is the validation error returned by +// UpdatePodRequest.Validate if the designated constraints aren't met. +type UpdatePodRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdatePodRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdatePodRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdatePodRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdatePodRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdatePodRequestValidationError) ErrorName() string { return "UpdatePodRequestValidationError" } + +// Error satisfies the builtin error interface +func (e UpdatePodRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdatePodRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdatePodRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdatePodRequestValidationError{} + +// Validate checks the field values on UpdatePodResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *UpdatePodResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// UpdatePodResponseValidationError is the validation error returned by +// UpdatePodResponse.Validate if the designated constraints aren't met. +type UpdatePodResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdatePodResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdatePodResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdatePodResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdatePodResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdatePodResponseValidationError) ErrorName() string { + return "UpdatePodResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdatePodResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdatePodResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdatePodResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdatePodResponseValidationError{} + +// Validate checks the field values on HPA with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *HPA) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Cluster + + // no validation rules for Namespace + + // no validation rules for Name + + if v, ok := interface{}(m.GetSizing()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HPAValidationError{ + field: "Sizing", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Labels + + // no validation rules for Annotations + + return nil +} + +// HPAValidationError is the validation error returned by HPA.Validate if the +// designated constraints aren't met. +type HPAValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HPAValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HPAValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HPAValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HPAValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HPAValidationError) ErrorName() string { return "HPAValidationError" } + +// Error satisfies the builtin error interface +func (e HPAValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHPA.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HPAValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HPAValidationError{} + +// Validate checks the field values on ResizeHPARequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ResizeHPARequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return ResizeHPARequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return ResizeHPARequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return ResizeHPARequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return ResizeHPARequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetSizing() == nil { + return ResizeHPARequestValidationError{ + field: "Sizing", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetSizing()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResizeHPARequestValidationError{ + field: "Sizing", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// ResizeHPARequestValidationError is the validation error returned by +// ResizeHPARequest.Validate if the designated constraints aren't met. +type ResizeHPARequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResizeHPARequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResizeHPARequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResizeHPARequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResizeHPARequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResizeHPARequestValidationError) ErrorName() string { return "ResizeHPARequestValidationError" } + +// Error satisfies the builtin error interface +func (e ResizeHPARequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResizeHPARequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResizeHPARequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResizeHPARequestValidationError{} + +// Validate checks the field values on ResizeHPAResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ResizeHPAResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// ResizeHPAResponseValidationError is the validation error returned by +// ResizeHPAResponse.Validate if the designated constraints aren't met. +type ResizeHPAResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResizeHPAResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResizeHPAResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResizeHPAResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResizeHPAResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResizeHPAResponseValidationError) ErrorName() string { + return "ResizeHPAResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ResizeHPAResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResizeHPAResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResizeHPAResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResizeHPAResponseValidationError{} + +// Validate checks the field values on Deployment with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Deployment) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Cluster + + // no validation rules for Namespace + + // no validation rules for Name + + // no validation rules for Labels + + // no validation rules for Annotations + + return nil +} + +// DeploymentValidationError is the validation error returned by +// Deployment.Validate if the designated constraints aren't met. +type DeploymentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeploymentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeploymentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeploymentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeploymentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeploymentValidationError) ErrorName() string { return "DeploymentValidationError" } + +// Error satisfies the builtin error interface +func (e DeploymentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeployment.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeploymentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeploymentValidationError{} + +// Validate checks the field values on UpdateDeploymentRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateDeploymentRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClientset()) < 1 { + return UpdateDeploymentRequestValidationError{ + field: "Clientset", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return UpdateDeploymentRequestValidationError{ + field: "Cluster", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetNamespace()) < 1 { + return UpdateDeploymentRequestValidationError{ + field: "Namespace", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return UpdateDeploymentRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetFields() == nil { + return UpdateDeploymentRequestValidationError{ + field: "Fields", + reason: "value is required", + } + } + + if v, ok := interface{}(m.GetFields()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateDeploymentRequestValidationError{ + field: "Fields", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// UpdateDeploymentRequestValidationError is the validation error returned by +// UpdateDeploymentRequest.Validate if the designated constraints aren't met. +type UpdateDeploymentRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateDeploymentRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateDeploymentRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateDeploymentRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateDeploymentRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateDeploymentRequestValidationError) ErrorName() string { + return "UpdateDeploymentRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateDeploymentRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateDeploymentRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateDeploymentRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateDeploymentRequestValidationError{} + +// Validate checks the field values on UpdateDeploymentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateDeploymentResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// UpdateDeploymentResponseValidationError is the validation error returned by +// UpdateDeploymentResponse.Validate if the designated constraints aren't met. +type UpdateDeploymentResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateDeploymentResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateDeploymentResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateDeploymentResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateDeploymentResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateDeploymentResponseValidationError) ErrorName() string { + return "UpdateDeploymentResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateDeploymentResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateDeploymentResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateDeploymentResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateDeploymentResponseValidationError{} + +// Validate checks the field values on NullableString with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *NullableString) Validate() error { + if m == nil { + return nil + } + + switch m.Kind.(type) { + + case *NullableString_Null: + // no validation rules for Null + + case *NullableString_Value: + // no validation rules for Value + + } + + return nil +} + +// NullableStringValidationError is the validation error returned by +// NullableString.Validate if the designated constraints aren't met. +type NullableStringValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NullableStringValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NullableStringValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NullableStringValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NullableStringValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NullableStringValidationError) ErrorName() string { return "NullableStringValidationError" } + +// Error satisfies the builtin error interface +func (e NullableStringValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNullableString.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NullableStringValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NullableStringValidationError{} + +// Validate checks the field values on ExpectedObjectMetaFields with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ExpectedObjectMetaFields) Validate() error { + if m == nil { + return nil + } + + for key, val := range m.GetLabels() { + _ = val + + if len(key) < 1 { + return ExpectedObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Labels[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExpectedObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Labels[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for key, val := range m.GetAnnotations() { + _ = val + + if len(key) < 1 { + return ExpectedObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Annotations[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExpectedObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Annotations[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ExpectedObjectMetaFieldsValidationError is the validation error returned by +// ExpectedObjectMetaFields.Validate if the designated constraints aren't met. +type ExpectedObjectMetaFieldsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExpectedObjectMetaFieldsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExpectedObjectMetaFieldsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExpectedObjectMetaFieldsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExpectedObjectMetaFieldsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExpectedObjectMetaFieldsValidationError) ErrorName() string { + return "ExpectedObjectMetaFieldsValidationError" +} + +// Error satisfies the builtin error interface +func (e ExpectedObjectMetaFieldsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExpectedObjectMetaFields.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExpectedObjectMetaFieldsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExpectedObjectMetaFieldsValidationError{} + +// Validate checks the field values on ObjectMetaFields with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ObjectMetaFields) Validate() error { + if m == nil { + return nil + } + + for key, val := range m.GetLabels() { + _ = val + + if len(key) < 1 { + return ObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Labels[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Labels[key] + } + + for key, val := range m.GetAnnotations() { + _ = val + + if len(key) < 1 { + return ObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Annotations[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Annotations[key] + } + + return nil +} + +// ObjectMetaFieldsValidationError is the validation error returned by +// ObjectMetaFields.Validate if the designated constraints aren't met. +type ObjectMetaFieldsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ObjectMetaFieldsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ObjectMetaFieldsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ObjectMetaFieldsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ObjectMetaFieldsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ObjectMetaFieldsValidationError) ErrorName() string { return "ObjectMetaFieldsValidationError" } + +// Error satisfies the builtin error interface +func (e ObjectMetaFieldsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sObjectMetaFields.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ObjectMetaFieldsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ObjectMetaFieldsValidationError{} + +// Validate checks the field values on RemoveObjectMetaFields with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RemoveObjectMetaFields) Validate() error { + if m == nil { + return nil + } + + _RemoveObjectMetaFields_Labels_Unique := make(map[string]struct{}, len(m.GetLabels())) + + for idx, item := range m.GetLabels() { + _, _ = idx, item + + if _, exists := _RemoveObjectMetaFields_Labels_Unique[item]; exists { + return RemoveObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Labels[%v]", idx), + reason: "repeated value must contain unique items", + } + } else { + _RemoveObjectMetaFields_Labels_Unique[item] = struct{}{} + } + + // no validation rules for Labels[idx] + } + + _RemoveObjectMetaFields_Annotations_Unique := make(map[string]struct{}, len(m.GetAnnotations())) + + for idx, item := range m.GetAnnotations() { + _, _ = idx, item + + if _, exists := _RemoveObjectMetaFields_Annotations_Unique[item]; exists { + return RemoveObjectMetaFieldsValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "repeated value must contain unique items", + } + } else { + _RemoveObjectMetaFields_Annotations_Unique[item] = struct{}{} + } + + // no validation rules for Annotations[idx] + } + + return nil +} + +// RemoveObjectMetaFieldsValidationError is the validation error returned by +// RemoveObjectMetaFields.Validate if the designated constraints aren't met. +type RemoveObjectMetaFieldsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RemoveObjectMetaFieldsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RemoveObjectMetaFieldsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RemoveObjectMetaFieldsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RemoveObjectMetaFieldsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RemoveObjectMetaFieldsValidationError) ErrorName() string { + return "RemoveObjectMetaFieldsValidationError" +} + +// Error satisfies the builtin error interface +func (e RemoveObjectMetaFieldsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRemoveObjectMetaFields.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RemoveObjectMetaFieldsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RemoveObjectMetaFieldsValidationError{} + +// Validate checks the field values on HPA_Sizing with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HPA_Sizing) Validate() error { + if m == nil { + return nil + } + + // no validation rules for MinReplicas + + // no validation rules for MaxReplicas + + // no validation rules for CurrentReplicas + + // no validation rules for DesiredReplicas + + return nil +} + +// HPA_SizingValidationError is the validation error returned by +// HPA_Sizing.Validate if the designated constraints aren't met. +type HPA_SizingValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HPA_SizingValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HPA_SizingValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HPA_SizingValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HPA_SizingValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HPA_SizingValidationError) ErrorName() string { return "HPA_SizingValidationError" } + +// Error satisfies the builtin error interface +func (e HPA_SizingValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHPA_Sizing.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HPA_SizingValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HPA_SizingValidationError{} + +// Validate checks the field values on ResizeHPARequest_Sizing with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ResizeHPARequest_Sizing) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Min + + // no validation rules for Max + + return nil +} + +// ResizeHPARequest_SizingValidationError is the validation error returned by +// ResizeHPARequest_Sizing.Validate if the designated constraints aren't met. +type ResizeHPARequest_SizingValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResizeHPARequest_SizingValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResizeHPARequest_SizingValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResizeHPARequest_SizingValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResizeHPARequest_SizingValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResizeHPARequest_SizingValidationError) ErrorName() string { + return "ResizeHPARequest_SizingValidationError" +} + +// Error satisfies the builtin error interface +func (e ResizeHPARequest_SizingValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResizeHPARequest_Sizing.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResizeHPARequest_SizingValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResizeHPARequest_SizingValidationError{} + +// Validate checks the field values on UpdateDeploymentRequest_Fields with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateDeploymentRequest_Fields) Validate() error { + if m == nil { + return nil + } + + for key, val := range m.GetLabels() { + _ = val + + if len(key) < 1 { + return UpdateDeploymentRequest_FieldsValidationError{ + field: fmt.Sprintf("Labels[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Labels[key] + } + + for key, val := range m.GetAnnotations() { + _ = val + + if len(key) < 1 { + return UpdateDeploymentRequest_FieldsValidationError{ + field: fmt.Sprintf("Annotations[%v]", key), + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Annotations[key] + } + + return nil +} + +// UpdateDeploymentRequest_FieldsValidationError is the validation error +// returned by UpdateDeploymentRequest_Fields.Validate if the designated +// constraints aren't met. +type UpdateDeploymentRequest_FieldsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateDeploymentRequest_FieldsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateDeploymentRequest_FieldsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateDeploymentRequest_FieldsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateDeploymentRequest_FieldsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateDeploymentRequest_FieldsValidationError) ErrorName() string { + return "UpdateDeploymentRequest_FieldsValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateDeploymentRequest_FieldsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateDeploymentRequest_Fields.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateDeploymentRequest_FieldsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateDeploymentRequest_FieldsValidationError{} diff --git a/backend/api/resolver/aws/v1/aws.pb.go b/backend/api/resolver/aws/v1/aws.pb.go new file mode 100644 index 0000000000..f52c6099bc --- /dev/null +++ b/backend/api/resolver/aws/v1/aws.pb.go @@ -0,0 +1,323 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: resolver/aws/v1/aws.proto + +package awsv1 + +import ( + proto "github.com/golang/protobuf/proto" + _ "github.com/golang/protobuf/protoc-gen-go/descriptor" + _ "github.com/lyft/clutch/backend/api/resolver/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type InstanceID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *InstanceID) Reset() { + *x = InstanceID{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceID) ProtoMessage() {} + +func (x *InstanceID) ProtoReflect() protoreflect.Message { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstanceID.ProtoReflect.Descriptor instead. +func (*InstanceID) Descriptor() ([]byte, []int) { + return file_resolver_aws_v1_aws_proto_rawDescGZIP(), []int{0} +} + +func (x *InstanceID) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *InstanceID) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +type AutoscalingGroupName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *AutoscalingGroupName) Reset() { + *x = AutoscalingGroupName{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoscalingGroupName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoscalingGroupName) ProtoMessage() {} + +func (x *AutoscalingGroupName) ProtoReflect() protoreflect.Message { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoscalingGroupName.ProtoReflect.Descriptor instead. +func (*AutoscalingGroupName) Descriptor() ([]byte, []int) { + return file_resolver_aws_v1_aws_proto_rawDescGZIP(), []int{1} +} + +func (x *AutoscalingGroupName) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AutoscalingGroupName) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +type KinesisStreamName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` +} + +func (x *KinesisStreamName) Reset() { + *x = KinesisStreamName{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KinesisStreamName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KinesisStreamName) ProtoMessage() {} + +func (x *KinesisStreamName) ProtoReflect() protoreflect.Message { + mi := &file_resolver_aws_v1_aws_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KinesisStreamName.ProtoReflect.Descriptor instead. +func (*KinesisStreamName) Descriptor() ([]byte, []int) { + return file_resolver_aws_v1_aws_proto_rawDescGZIP(), []int{2} +} + +func (x *KinesisStreamName) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *KinesisStreamName) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +var File_resolver_aws_v1_aws_proto protoreflect.FileDescriptor + +var file_resolver_aws_v1_aws_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x61, 0x77, 0x73, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1a, 0xea, 0x9f, 0x1d, 0x16, 0x0a, 0x02, 0x49, 0x44, 0x10, 0x01, 0x1a, 0x0e, 0x0a, 0x0c, 0x69, + 0x2d, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x31, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x19, 0xea, 0x9f, 0x1d, 0x15, 0x0a, 0x06, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x22, 0x0b, 0x08, + 0x01, 0x12, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x3a, 0x13, 0xea, 0x9f, 0x1d, 0x0f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x20, 0x49, 0x44, 0x10, 0x01, 0x22, 0x96, 0x01, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x6f, + 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x3d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, + 0xea, 0x9f, 0x1d, 0x25, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x1a, 0x1b, 0x0a, 0x19, + 0x6d, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x6f, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x2d, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x31, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x19, 0xea, 0x9f, 0x1d, 0x15, 0x0a, 0x06, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x22, 0x0b, 0x08, + 0x01, 0x12, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x3a, 0x0c, 0xea, 0x9f, 0x1d, 0x08, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x10, 0x01, + 0x22, 0x90, 0x01, 0x0a, 0x11, 0x4b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xea, 0x9f, 0x1d, 0x22, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, + 0x10, 0x01, 0x1a, 0x18, 0x0a, 0x16, 0x6d, 0x79, 0x2d, 0x6b, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x19, 0xea, 0x9f, 0x1d, 0x15, 0x0a, 0x06, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x22, 0x0b, 0x08, 0x01, 0x12, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x3a, 0x0c, 0xea, 0x9f, 0x1d, 0x08, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x10, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x61, 0x77, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_resolver_aws_v1_aws_proto_rawDescOnce sync.Once + file_resolver_aws_v1_aws_proto_rawDescData = file_resolver_aws_v1_aws_proto_rawDesc +) + +func file_resolver_aws_v1_aws_proto_rawDescGZIP() []byte { + file_resolver_aws_v1_aws_proto_rawDescOnce.Do(func() { + file_resolver_aws_v1_aws_proto_rawDescData = protoimpl.X.CompressGZIP(file_resolver_aws_v1_aws_proto_rawDescData) + }) + return file_resolver_aws_v1_aws_proto_rawDescData +} + +var file_resolver_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_resolver_aws_v1_aws_proto_goTypes = []interface{}{ + (*InstanceID)(nil), // 0: clutch.resolver.aws.v1.InstanceID + (*AutoscalingGroupName)(nil), // 1: clutch.resolver.aws.v1.AutoscalingGroupName + (*KinesisStreamName)(nil), // 2: clutch.resolver.aws.v1.KinesisStreamName +} +var file_resolver_aws_v1_aws_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_resolver_aws_v1_aws_proto_init() } +func file_resolver_aws_v1_aws_proto_init() { + if File_resolver_aws_v1_aws_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_resolver_aws_v1_aws_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_aws_v1_aws_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoscalingGroupName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_aws_v1_aws_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KinesisStreamName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_resolver_aws_v1_aws_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_resolver_aws_v1_aws_proto_goTypes, + DependencyIndexes: file_resolver_aws_v1_aws_proto_depIdxs, + MessageInfos: file_resolver_aws_v1_aws_proto_msgTypes, + }.Build() + File_resolver_aws_v1_aws_proto = out.File + file_resolver_aws_v1_aws_proto_rawDesc = nil + file_resolver_aws_v1_aws_proto_goTypes = nil + file_resolver_aws_v1_aws_proto_depIdxs = nil +} diff --git a/backend/api/resolver/aws/v1/aws.pb.validate.go b/backend/api/resolver/aws/v1/aws.pb.validate.go new file mode 100644 index 0000000000..e3720fd6fa --- /dev/null +++ b/backend/api/resolver/aws/v1/aws.pb.validate.go @@ -0,0 +1,247 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: resolver/aws/v1/aws.proto + +package awsv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _aws_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on InstanceID with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *InstanceID) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + // no validation rules for Region + + return nil +} + +// InstanceIDValidationError is the validation error returned by +// InstanceID.Validate if the designated constraints aren't met. +type InstanceIDValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e InstanceIDValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e InstanceIDValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e InstanceIDValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e InstanceIDValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e InstanceIDValidationError) ErrorName() string { return "InstanceIDValidationError" } + +// Error satisfies the builtin error interface +func (e InstanceIDValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInstanceID.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = InstanceIDValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = InstanceIDValidationError{} + +// Validate checks the field values on AutoscalingGroupName with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AutoscalingGroupName) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Region + + return nil +} + +// AutoscalingGroupNameValidationError is the validation error returned by +// AutoscalingGroupName.Validate if the designated constraints aren't met. +type AutoscalingGroupNameValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AutoscalingGroupNameValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AutoscalingGroupNameValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AutoscalingGroupNameValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AutoscalingGroupNameValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AutoscalingGroupNameValidationError) ErrorName() string { + return "AutoscalingGroupNameValidationError" +} + +// Error satisfies the builtin error interface +func (e AutoscalingGroupNameValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAutoscalingGroupName.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AutoscalingGroupNameValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AutoscalingGroupNameValidationError{} + +// Validate checks the field values on KinesisStreamName with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *KinesisStreamName) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Region + + return nil +} + +// KinesisStreamNameValidationError is the validation error returned by +// KinesisStreamName.Validate if the designated constraints aren't met. +type KinesisStreamNameValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e KinesisStreamNameValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e KinesisStreamNameValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e KinesisStreamNameValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e KinesisStreamNameValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e KinesisStreamNameValidationError) ErrorName() string { + return "KinesisStreamNameValidationError" +} + +// Error satisfies the builtin error interface +func (e KinesisStreamNameValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sKinesisStreamName.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = KinesisStreamNameValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = KinesisStreamNameValidationError{} diff --git a/backend/api/resolver/k8s/v1/k8s.pb.go b/backend/api/resolver/k8s/v1/k8s.pb.go new file mode 100644 index 0000000000..d5197c1224 --- /dev/null +++ b/backend/api/resolver/k8s/v1/k8s.pb.go @@ -0,0 +1,424 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: resolver/k8s/v1/k8s.proto + +package k8sv1 + +import ( + proto "github.com/golang/protobuf/proto" + _ "github.com/golang/protobuf/protoc-gen-go/descriptor" + _ "github.com/lyft/clutch/backend/api/resolver/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type PodID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Clientset string `protobuf:"bytes,2,opt,name=clientset,proto3" json:"clientset,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *PodID) Reset() { + *x = PodID{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PodID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PodID) ProtoMessage() {} + +func (x *PodID) ProtoReflect() protoreflect.Message { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PodID.ProtoReflect.Descriptor instead. +func (*PodID) Descriptor() ([]byte, []int) { + return file_resolver_k8s_v1_k8s_proto_rawDescGZIP(), []int{0} +} + +func (x *PodID) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PodID) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *PodID) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type IPAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpAddress string `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` +} + +func (x *IPAddress) Reset() { + *x = IPAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPAddress) ProtoMessage() {} + +func (x *IPAddress) ProtoReflect() protoreflect.Message { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IPAddress.ProtoReflect.Descriptor instead. +func (*IPAddress) Descriptor() ([]byte, []int) { + return file_resolver_k8s_v1_k8s_proto_rawDescGZIP(), []int{1} +} + +func (x *IPAddress) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +type HPAName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Clientset string `protobuf:"bytes,2,opt,name=clientset,proto3" json:"clientset,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *HPAName) Reset() { + *x = HPAName{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HPAName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HPAName) ProtoMessage() {} + +func (x *HPAName) ProtoReflect() protoreflect.Message { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HPAName.ProtoReflect.Descriptor instead. +func (*HPAName) Descriptor() ([]byte, []int) { + return file_resolver_k8s_v1_k8s_proto_rawDescGZIP(), []int{2} +} + +func (x *HPAName) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HPAName) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *HPAName) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type Deployment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Clientset string `protobuf:"bytes,2,opt,name=clientset,proto3" json:"clientset,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *Deployment) Reset() { + *x = Deployment{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_resolver_k8s_v1_k8s_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_resolver_k8s_v1_k8s_proto_rawDescGZIP(), []int{3} +} + +func (x *Deployment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Deployment) GetClientset() string { + if x != nil { + return x.Clientset + } + return "" +} + +func (x *Deployment) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +var File_resolver_k8s_v1_k8s_proto protoreflect.FileDescriptor + +var file_resolver_k8s_v1_k8s_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x6b, 0x38, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x6b, 0x38, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x6b, 0x38, 0x73, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x64, 0x49, 0x44, 0x12, 0x2f, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xea, 0x9f, + 0x1d, 0x17, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x1a, 0x0d, 0x0a, 0x0b, 0x6d, 0x79, + 0x2d, 0x70, 0x6f, 0x64, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x3c, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1e, 0xea, 0x9f, 0x1d, 0x1a, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x65, 0x74, 0x10, 0x01, 0x22, 0x0b, 0x12, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, + 0x65, 0x74, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xea, 0x9f, 0x1d, 0x1d, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x10, 0x01, 0x1a, 0x0e, 0x0a, 0x0c, 0x6d, 0x79, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x0e, + 0xea, 0x9f, 0x1d, 0x0a, 0x0a, 0x06, 0x70, 0x6f, 0x64, 0x20, 0x49, 0x44, 0x10, 0x01, 0x22, 0x5c, + 0x0a, 0x09, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x69, + 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1e, 0xea, 0x9f, 0x1d, 0x1a, 0x0a, 0x0a, 0x49, 0x50, 0x20, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x10, 0x01, 0x1a, 0x0a, 0x0a, 0x08, 0x31, 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x52, + 0x09, 0x69, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0xea, 0x9f, 0x1d, 0x0c, + 0x0a, 0x0a, 0x49, 0x50, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xc7, 0x01, 0x0a, + 0x07, 0x48, 0x50, 0x41, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xea, 0x9f, 0x1d, 0x17, 0x0a, 0x04, 0x4e, 0x61, + 0x6d, 0x65, 0x10, 0x01, 0x1a, 0x0d, 0x0a, 0x0b, 0x6d, 0x79, 0x2d, 0x68, 0x70, 0x61, 0x2d, 0x6e, + 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xea, 0x9f, + 0x1d, 0x1a, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x10, 0x01, 0x22, + 0x0b, 0x12, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x52, 0x09, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xea, 0x9f, 0x1d, 0x1d, + 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x01, 0x1a, 0x0e, 0x0a, + 0x0c, 0x6d, 0x79, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x0c, 0xea, 0x9f, 0x1d, 0x08, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x22, 0xd1, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x22, 0xea, 0x9f, 0x1d, 0x1e, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, + 0x01, 0x1a, 0x14, 0x0a, 0x12, 0x6d, 0x79, 0x2d, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x1e, 0xea, 0x9f, 0x1d, 0x1a, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, + 0x74, 0x10, 0x01, 0x22, 0x0b, 0x12, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, + 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xea, 0x9f, 0x1d, 0x1d, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, + 0x01, 0x1a, 0x0e, 0x0a, 0x0c, 0x6d, 0x79, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x0c, 0xea, 0x9f, + 0x1d, 0x08, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x6b, 0x38, + 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_resolver_k8s_v1_k8s_proto_rawDescOnce sync.Once + file_resolver_k8s_v1_k8s_proto_rawDescData = file_resolver_k8s_v1_k8s_proto_rawDesc +) + +func file_resolver_k8s_v1_k8s_proto_rawDescGZIP() []byte { + file_resolver_k8s_v1_k8s_proto_rawDescOnce.Do(func() { + file_resolver_k8s_v1_k8s_proto_rawDescData = protoimpl.X.CompressGZIP(file_resolver_k8s_v1_k8s_proto_rawDescData) + }) + return file_resolver_k8s_v1_k8s_proto_rawDescData +} + +var file_resolver_k8s_v1_k8s_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_resolver_k8s_v1_k8s_proto_goTypes = []interface{}{ + (*PodID)(nil), // 0: clutch.resolver.k8s.v1.PodID + (*IPAddress)(nil), // 1: clutch.resolver.k8s.v1.IPAddress + (*HPAName)(nil), // 2: clutch.resolver.k8s.v1.HPAName + (*Deployment)(nil), // 3: clutch.resolver.k8s.v1.Deployment +} +var file_resolver_k8s_v1_k8s_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_resolver_k8s_v1_k8s_proto_init() } +func file_resolver_k8s_v1_k8s_proto_init() { + if File_resolver_k8s_v1_k8s_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_resolver_k8s_v1_k8s_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PodID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_k8s_v1_k8s_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IPAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_k8s_v1_k8s_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HPAName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_k8s_v1_k8s_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Deployment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_resolver_k8s_v1_k8s_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_resolver_k8s_v1_k8s_proto_goTypes, + DependencyIndexes: file_resolver_k8s_v1_k8s_proto_depIdxs, + MessageInfos: file_resolver_k8s_v1_k8s_proto_msgTypes, + }.Build() + File_resolver_k8s_v1_k8s_proto = out.File + file_resolver_k8s_v1_k8s_proto_rawDesc = nil + file_resolver_k8s_v1_k8s_proto_goTypes = nil + file_resolver_k8s_v1_k8s_proto_depIdxs = nil +} diff --git a/backend/api/resolver/k8s/v1/k8s.pb.validate.go b/backend/api/resolver/k8s/v1/k8s.pb.validate.go new file mode 100644 index 0000000000..81ffb094ff --- /dev/null +++ b/backend/api/resolver/k8s/v1/k8s.pb.validate.go @@ -0,0 +1,313 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: resolver/k8s/v1/k8s.proto + +package k8sv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _k_8_s_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on PodID with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *PodID) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Clientset + + // no validation rules for Namespace + + return nil +} + +// PodIDValidationError is the validation error returned by PodID.Validate if +// the designated constraints aren't met. +type PodIDValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PodIDValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PodIDValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PodIDValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PodIDValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PodIDValidationError) ErrorName() string { return "PodIDValidationError" } + +// Error satisfies the builtin error interface +func (e PodIDValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPodID.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PodIDValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PodIDValidationError{} + +// Validate checks the field values on IPAddress with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *IPAddress) Validate() error { + if m == nil { + return nil + } + + // no validation rules for IpAddress + + return nil +} + +// IPAddressValidationError is the validation error returned by +// IPAddress.Validate if the designated constraints aren't met. +type IPAddressValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e IPAddressValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e IPAddressValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e IPAddressValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e IPAddressValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e IPAddressValidationError) ErrorName() string { return "IPAddressValidationError" } + +// Error satisfies the builtin error interface +func (e IPAddressValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sIPAddress.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = IPAddressValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = IPAddressValidationError{} + +// Validate checks the field values on HPAName with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HPAName) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Clientset + + // no validation rules for Namespace + + return nil +} + +// HPANameValidationError is the validation error returned by HPAName.Validate +// if the designated constraints aren't met. +type HPANameValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HPANameValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HPANameValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HPANameValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HPANameValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HPANameValidationError) ErrorName() string { return "HPANameValidationError" } + +// Error satisfies the builtin error interface +func (e HPANameValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHPAName.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HPANameValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HPANameValidationError{} + +// Validate checks the field values on Deployment with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Deployment) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + // no validation rules for Clientset + + // no validation rules for Namespace + + return nil +} + +// DeploymentValidationError is the validation error returned by +// Deployment.Validate if the designated constraints aren't met. +type DeploymentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeploymentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeploymentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeploymentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeploymentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeploymentValidationError) ErrorName() string { return "DeploymentValidationError" } + +// Error satisfies the builtin error interface +func (e DeploymentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeployment.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeploymentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeploymentValidationError{} diff --git a/backend/api/resolver/v1/annotations.pb.go b/backend/api/resolver/v1/annotations.pb.go new file mode 100644 index 0000000000..94e23af0aa --- /dev/null +++ b/backend/api/resolver/v1/annotations.pb.go @@ -0,0 +1,133 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: resolver/v1/annotations.proto + +package resolverv1 + +import ( + proto "github.com/golang/protobuf/proto" + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var file_resolver_v1_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.MessageOptions)(nil), + ExtensionType: (*SchemaMetadata)(nil), + Field: 59901, + Name: "clutch.resolver.v1.schema", + Tag: "bytes,59901,opt,name=schema", + Filename: "resolver/v1/annotations.proto", + }, + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*FieldMetadata)(nil), + Field: 59901, + Name: "clutch.resolver.v1.schema_field", + Tag: "bytes,59901,opt,name=schema_field", + Filename: "resolver/v1/annotations.proto", + }, +} + +// Extension fields to descriptor.MessageOptions. +var ( + // Use a random high number that won't conflict with annotations from other + // libraries. + // + // optional clutch.resolver.v1.SchemaMetadata schema = 59901; + E_Schema = &file_resolver_v1_annotations_proto_extTypes[0] +) + +// Extension fields to descriptor.FieldOptions. +var ( + // Use a random high number that won't conflict with annotations from other + // libraries. + // + // optional clutch.resolver.v1.FieldMetadata schema_field = 59901; + E_SchemaField = &file_resolver_v1_annotations_proto_extTypes[1] +) + +var File_resolver_v1_annotations_proto protoreflect.FileDescriptor + +var file_resolver_v1_annotations_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x12, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, + 0x5d, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfd, 0xd3, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x3a, 0x65, + 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfd, 0xd3, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x0c, 0x5a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x72, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_resolver_v1_annotations_proto_goTypes = []interface{}{ + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.FieldOptions)(nil), // 1: google.protobuf.FieldOptions + (*SchemaMetadata)(nil), // 2: clutch.resolver.v1.SchemaMetadata + (*FieldMetadata)(nil), // 3: clutch.resolver.v1.FieldMetadata +} +var file_resolver_v1_annotations_proto_depIdxs = []int32{ + 0, // 0: clutch.resolver.v1.schema:extendee -> google.protobuf.MessageOptions + 1, // 1: clutch.resolver.v1.schema_field:extendee -> google.protobuf.FieldOptions + 2, // 2: clutch.resolver.v1.schema:type_name -> clutch.resolver.v1.SchemaMetadata + 3, // 3: clutch.resolver.v1.schema_field:type_name -> clutch.resolver.v1.FieldMetadata + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 2, // [2:4] is the sub-list for extension type_name + 0, // [0:2] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_resolver_v1_annotations_proto_init() } +func file_resolver_v1_annotations_proto_init() { + if File_resolver_v1_annotations_proto != nil { + return + } + file_resolver_v1_schema_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_resolver_v1_annotations_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 2, + NumServices: 0, + }, + GoTypes: file_resolver_v1_annotations_proto_goTypes, + DependencyIndexes: file_resolver_v1_annotations_proto_depIdxs, + ExtensionInfos: file_resolver_v1_annotations_proto_extTypes, + }.Build() + File_resolver_v1_annotations_proto = out.File + file_resolver_v1_annotations_proto_rawDesc = nil + file_resolver_v1_annotations_proto_goTypes = nil + file_resolver_v1_annotations_proto_depIdxs = nil +} diff --git a/backend/api/resolver/v1/annotations.pb.validate.go b/backend/api/resolver/v1/annotations.pb.validate.go new file mode 100644 index 0000000000..44d19eb9dd --- /dev/null +++ b/backend/api/resolver/v1/annotations.pb.validate.go @@ -0,0 +1,37 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: resolver/v1/annotations.proto + +package resolverv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _annotations_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") diff --git a/backend/api/resolver/v1/resolver_api.pb.go b/backend/api/resolver/v1/resolver_api.pb.go new file mode 100644 index 0000000000..ee6b139039 --- /dev/null +++ b/backend/api/resolver/v1/resolver_api.pb.go @@ -0,0 +1,762 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: resolver/v1/resolver_api.proto + +package resolverv1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + status "google.golang.org/genproto/googleapis/rpc/status" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status1 "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ResolveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type URL of the desired result. + Want string `protobuf:"bytes,1,opt,name=want,proto3" json:"want,omitempty"` + // Filled in object schemas. + Have *any.Any `protobuf:"bytes,2,opt,name=have,proto3" json:"have,omitempty"` + // The maximum number of results to return. + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *ResolveRequest) Reset() { + *x = ResolveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResolveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveRequest) ProtoMessage() {} + +func (x *ResolveRequest) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveRequest.ProtoReflect.Descriptor instead. +func (*ResolveRequest) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{0} +} + +func (x *ResolveRequest) GetWant() string { + if x != nil { + return x.Want + } + return "" +} + +func (x *ResolveRequest) GetHave() *any.Any { + if x != nil { + return x.Have + } + return nil +} + +func (x *ResolveRequest) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +type ResolveResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*any.Any `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + PartialFailures []*status.Status `protobuf:"bytes,2,rep,name=partial_failures,json=partialFailures,proto3" json:"partial_failures,omitempty"` +} + +func (x *ResolveResponse) Reset() { + *x = ResolveResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResolveResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveResponse) ProtoMessage() {} + +func (x *ResolveResponse) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveResponse.ProtoReflect.Descriptor instead. +func (*ResolveResponse) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{1} +} + +func (x *ResolveResponse) GetResults() []*any.Any { + if x != nil { + return x.Results + } + return nil +} + +func (x *ResolveResponse) GetPartialFailures() []*status.Status { + if x != nil { + return x.PartialFailures + } + return nil +} + +type SearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type URL of the desired result. + Want string `protobuf:"bytes,1,opt,name=want,proto3" json:"want,omitempty"` + // Free-form text query. + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + // The maximum number of results to return. + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest) ProtoMessage() {} + +func (x *SearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. +func (*SearchRequest) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{2} +} + +func (x *SearchRequest) GetWant() string { + if x != nil { + return x.Want + } + return "" +} + +func (x *SearchRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchRequest) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +type SearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*any.Any `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + PartialFailures []*status.Status `protobuf:"bytes,2,rep,name=partial_failures,json=partialFailures,proto3" json:"partial_failures,omitempty"` +} + +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse) ProtoMessage() {} + +func (x *SearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. +func (*SearchResponse) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{3} +} + +func (x *SearchResponse) GetResults() []*any.Any { + if x != nil { + return x.Results + } + return nil +} + +func (x *SearchResponse) GetPartialFailures() []*status.Status { + if x != nil { + return x.PartialFailures + } + return nil +} + +type GetObjectSchemasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` +} + +func (x *GetObjectSchemasRequest) Reset() { + *x = GetObjectSchemasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetObjectSchemasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetObjectSchemasRequest) ProtoMessage() {} + +func (x *GetObjectSchemasRequest) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetObjectSchemasRequest.ProtoReflect.Descriptor instead. +func (*GetObjectSchemasRequest) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{4} +} + +func (x *GetObjectSchemasRequest) GetTypeUrl() string { + if x != nil { + return x.TypeUrl + } + return "" +} + +type GetObjectSchemasResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` + Schemas []*Schema `protobuf:"bytes,2,rep,name=schemas,proto3" json:"schemas,omitempty"` +} + +func (x *GetObjectSchemasResponse) Reset() { + *x = GetObjectSchemasResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetObjectSchemasResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetObjectSchemasResponse) ProtoMessage() {} + +func (x *GetObjectSchemasResponse) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_resolver_api_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetObjectSchemasResponse.ProtoReflect.Descriptor instead. +func (*GetObjectSchemasResponse) Descriptor() ([]byte, []int) { + return file_resolver_v1_resolver_api_proto_rawDescGZIP(), []int{5} +} + +func (x *GetObjectSchemasResponse) GetTypeUrl() string { + if x != nil { + return x.TypeUrl + } + return "" +} + +func (x *GetObjectSchemasResponse) GetSchemas() []*Schema { + if x != nil { + return x.Schemas + } + return nil +} + +var File_resolver_v1_resolver_api_proto protoreflect.FileDescriptor + +var file_resolver_v1_resolver_api_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x77, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x77, 0x61, + 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x68, 0x61, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xa2, 0x01, 0x02, 0x08, 0x01, + 0x52, 0x04, 0x68, 0x61, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x80, 0x01, 0x0a, + 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x3d, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x66, 0x61, 0x69, 0x6c, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0f, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x22, + 0x61, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x04, 0x77, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x04, 0x77, 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x7f, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x46, 0x61, 0x69, 0x6c, 0x75, + 0x72, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, + 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, + 0x72, 0x6c, 0x22, 0x6b, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x07, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x32, + 0x9f, 0x03, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x41, 0x50, 0x49, 0x12, + 0x9d, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, + 0x75, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, + 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x02, 0x12, 0x79, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, + 0x02, 0x42, 0x0c, 0x5a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_resolver_v1_resolver_api_proto_rawDescOnce sync.Once + file_resolver_v1_resolver_api_proto_rawDescData = file_resolver_v1_resolver_api_proto_rawDesc +) + +func file_resolver_v1_resolver_api_proto_rawDescGZIP() []byte { + file_resolver_v1_resolver_api_proto_rawDescOnce.Do(func() { + file_resolver_v1_resolver_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_resolver_v1_resolver_api_proto_rawDescData) + }) + return file_resolver_v1_resolver_api_proto_rawDescData +} + +var file_resolver_v1_resolver_api_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_resolver_v1_resolver_api_proto_goTypes = []interface{}{ + (*ResolveRequest)(nil), // 0: clutch.resolver.v1.ResolveRequest + (*ResolveResponse)(nil), // 1: clutch.resolver.v1.ResolveResponse + (*SearchRequest)(nil), // 2: clutch.resolver.v1.SearchRequest + (*SearchResponse)(nil), // 3: clutch.resolver.v1.SearchResponse + (*GetObjectSchemasRequest)(nil), // 4: clutch.resolver.v1.GetObjectSchemasRequest + (*GetObjectSchemasResponse)(nil), // 5: clutch.resolver.v1.GetObjectSchemasResponse + (*any.Any)(nil), // 6: google.protobuf.Any + (*status.Status)(nil), // 7: google.rpc.Status + (*Schema)(nil), // 8: clutch.resolver.v1.Schema +} +var file_resolver_v1_resolver_api_proto_depIdxs = []int32{ + 6, // 0: clutch.resolver.v1.ResolveRequest.have:type_name -> google.protobuf.Any + 6, // 1: clutch.resolver.v1.ResolveResponse.results:type_name -> google.protobuf.Any + 7, // 2: clutch.resolver.v1.ResolveResponse.partial_failures:type_name -> google.rpc.Status + 6, // 3: clutch.resolver.v1.SearchResponse.results:type_name -> google.protobuf.Any + 7, // 4: clutch.resolver.v1.SearchResponse.partial_failures:type_name -> google.rpc.Status + 8, // 5: clutch.resolver.v1.GetObjectSchemasResponse.schemas:type_name -> clutch.resolver.v1.Schema + 4, // 6: clutch.resolver.v1.ResolverAPI.GetObjectSchemas:input_type -> clutch.resolver.v1.GetObjectSchemasRequest + 2, // 7: clutch.resolver.v1.ResolverAPI.Search:input_type -> clutch.resolver.v1.SearchRequest + 0, // 8: clutch.resolver.v1.ResolverAPI.Resolve:input_type -> clutch.resolver.v1.ResolveRequest + 5, // 9: clutch.resolver.v1.ResolverAPI.GetObjectSchemas:output_type -> clutch.resolver.v1.GetObjectSchemasResponse + 3, // 10: clutch.resolver.v1.ResolverAPI.Search:output_type -> clutch.resolver.v1.SearchResponse + 1, // 11: clutch.resolver.v1.ResolverAPI.Resolve:output_type -> clutch.resolver.v1.ResolveResponse + 9, // [9:12] is the sub-list for method output_type + 6, // [6:9] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_resolver_v1_resolver_api_proto_init() } +func file_resolver_v1_resolver_api_proto_init() { + if File_resolver_v1_resolver_api_proto != nil { + return + } + file_resolver_v1_schema_proto_init() + if !protoimpl.UnsafeEnabled { + file_resolver_v1_resolver_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResolveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_resolver_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResolveResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_resolver_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_resolver_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_resolver_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetObjectSchemasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_resolver_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetObjectSchemasResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_resolver_v1_resolver_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_resolver_v1_resolver_api_proto_goTypes, + DependencyIndexes: file_resolver_v1_resolver_api_proto_depIdxs, + MessageInfos: file_resolver_v1_resolver_api_proto_msgTypes, + }.Build() + File_resolver_v1_resolver_api_proto = out.File + file_resolver_v1_resolver_api_proto_rawDesc = nil + file_resolver_v1_resolver_api_proto_goTypes = nil + file_resolver_v1_resolver_api_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ResolverAPIClient is the client API for ResolverAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ResolverAPIClient interface { + GetObjectSchemas(ctx context.Context, in *GetObjectSchemasRequest, opts ...grpc.CallOption) (*GetObjectSchemasResponse, error) + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) + Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error) +} + +type resolverAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewResolverAPIClient(cc grpc.ClientConnInterface) ResolverAPIClient { + return &resolverAPIClient{cc} +} + +func (c *resolverAPIClient) GetObjectSchemas(ctx context.Context, in *GetObjectSchemasRequest, opts ...grpc.CallOption) (*GetObjectSchemasResponse, error) { + out := new(GetObjectSchemasResponse) + err := c.cc.Invoke(ctx, "/clutch.resolver.v1.ResolverAPI/GetObjectSchemas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *resolverAPIClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { + out := new(SearchResponse) + err := c.cc.Invoke(ctx, "/clutch.resolver.v1.ResolverAPI/Search", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *resolverAPIClient) Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error) { + out := new(ResolveResponse) + err := c.cc.Invoke(ctx, "/clutch.resolver.v1.ResolverAPI/Resolve", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ResolverAPIServer is the server API for ResolverAPI service. +type ResolverAPIServer interface { + GetObjectSchemas(context.Context, *GetObjectSchemasRequest) (*GetObjectSchemasResponse, error) + Search(context.Context, *SearchRequest) (*SearchResponse, error) + Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error) +} + +// UnimplementedResolverAPIServer can be embedded to have forward compatible implementations. +type UnimplementedResolverAPIServer struct { +} + +func (*UnimplementedResolverAPIServer) GetObjectSchemas(context.Context, *GetObjectSchemasRequest) (*GetObjectSchemasResponse, error) { + return nil, status1.Errorf(codes.Unimplemented, "method GetObjectSchemas not implemented") +} +func (*UnimplementedResolverAPIServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) { + return nil, status1.Errorf(codes.Unimplemented, "method Search not implemented") +} +func (*UnimplementedResolverAPIServer) Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error) { + return nil, status1.Errorf(codes.Unimplemented, "method Resolve not implemented") +} + +func RegisterResolverAPIServer(s *grpc.Server, srv ResolverAPIServer) { + s.RegisterService(&_ResolverAPI_serviceDesc, srv) +} + +func _ResolverAPI_GetObjectSchemas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetObjectSchemasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResolverAPIServer).GetObjectSchemas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.resolver.v1.ResolverAPI/GetObjectSchemas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResolverAPIServer).GetObjectSchemas(ctx, req.(*GetObjectSchemasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ResolverAPI_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResolverAPIServer).Search(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.resolver.v1.ResolverAPI/Search", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResolverAPIServer).Search(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ResolverAPI_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResolveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResolverAPIServer).Resolve(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.resolver.v1.ResolverAPI/Resolve", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResolverAPIServer).Resolve(ctx, req.(*ResolveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ResolverAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.resolver.v1.ResolverAPI", + HandlerType: (*ResolverAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetObjectSchemas", + Handler: _ResolverAPI_GetObjectSchemas_Handler, + }, + { + MethodName: "Search", + Handler: _ResolverAPI_Search_Handler, + }, + { + MethodName: "Resolve", + Handler: _ResolverAPI_Resolve_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "resolver/v1/resolver_api.proto", +} diff --git a/backend/api/resolver/v1/resolver_api.pb.gw.go b/backend/api/resolver/v1/resolver_api.pb.gw.go new file mode 100644 index 0000000000..508cde2d23 --- /dev/null +++ b/backend/api/resolver/v1/resolver_api.pb.gw.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: resolver/v1/resolver_api.proto + +/* +Package resolverv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package resolverv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + status_0 "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ResolverAPI_GetObjectSchemas_0(ctx context.Context, marshaler runtime.Marshaler, client ResolverAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetObjectSchemasRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetObjectSchemas(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ResolverAPI_GetObjectSchemas_0(ctx context.Context, marshaler runtime.Marshaler, server ResolverAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetObjectSchemasRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetObjectSchemas(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ResolverAPI_Search_0(ctx context.Context, marshaler runtime.Marshaler, client ResolverAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Search(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ResolverAPI_Search_0(ctx context.Context, marshaler runtime.Marshaler, server ResolverAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Search(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ResolverAPI_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, client ResolverAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResolveRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Resolve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ResolverAPI_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, server ResolverAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ResolveRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Resolve(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterResolverAPIHandlerServer registers the http handlers for service ResolverAPI to "mux". +// UnaryRPC :call ResolverAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterResolverAPIHandlerFromEndpoint instead. +func RegisterResolverAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ResolverAPIServer) error { + + mux.Handle("POST", pattern_ResolverAPI_GetObjectSchemas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/GetObjectSchemas") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ResolverAPI_GetObjectSchemas_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_GetObjectSchemas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResolverAPI_Search_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/Search") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ResolverAPI_Search_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_Search_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResolverAPI_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/Resolve") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ResolverAPI_Resolve_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterResolverAPIHandlerFromEndpoint is same as RegisterResolverAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterResolverAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterResolverAPIHandler(ctx, mux, conn) +} + +// RegisterResolverAPIHandler registers the http handlers for service ResolverAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterResolverAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterResolverAPIHandlerClient(ctx, mux, NewResolverAPIClient(conn)) +} + +// RegisterResolverAPIHandlerClient registers the http handlers for service ResolverAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ResolverAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ResolverAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ResolverAPIClient" to call the correct interceptors. +func RegisterResolverAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ResolverAPIClient) error { + + mux.Handle("POST", pattern_ResolverAPI_GetObjectSchemas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/GetObjectSchemas") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ResolverAPI_GetObjectSchemas_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_GetObjectSchemas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResolverAPI_Search_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/Search") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ResolverAPI_Search_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_Search_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResolverAPI_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.resolver.v1.ResolverAPI/Resolve") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ResolverAPI_Resolve_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResolverAPI_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ResolverAPI_GetObjectSchemas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "resolver", "getObjectSchemas"}, "")) + + pattern_ResolverAPI_Search_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "resolver", "search"}, "")) + + pattern_ResolverAPI_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "resolver", "resolve"}, "")) +) + +var ( + forward_ResolverAPI_GetObjectSchemas_0 = runtime.ForwardResponseMessage + + forward_ResolverAPI_Search_0 = runtime.ForwardResponseMessage + + forward_ResolverAPI_Resolve_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/resolver/v1/resolver_api.pb.validate.go b/backend/api/resolver/v1/resolver_api.pb.validate.go new file mode 100644 index 0000000000..3e568bfb3f --- /dev/null +++ b/backend/api/resolver/v1/resolver_api.pb.validate.go @@ -0,0 +1,551 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: resolver/v1/resolver_api.proto + +package resolverv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _resolver_api_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on ResolveRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ResolveRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetWant()) < 1 { + return ResolveRequestValidationError{ + field: "Want", + reason: "value length must be at least 1 bytes", + } + } + + if m.GetHave() == nil { + return ResolveRequestValidationError{ + field: "Have", + reason: "value is required", + } + } + + if a := m.GetHave(); a != nil { + + } + + // no validation rules for Limit + + return nil +} + +// ResolveRequestValidationError is the validation error returned by +// ResolveRequest.Validate if the designated constraints aren't met. +type ResolveRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResolveRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResolveRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResolveRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResolveRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResolveRequestValidationError) ErrorName() string { return "ResolveRequestValidationError" } + +// Error satisfies the builtin error interface +func (e ResolveRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResolveRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResolveRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResolveRequestValidationError{} + +// Validate checks the field values on ResolveResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ResolveResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetResults() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResolveResponseValidationError{ + field: fmt.Sprintf("Results[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetPartialFailures() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResolveResponseValidationError{ + field: fmt.Sprintf("PartialFailures[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// ResolveResponseValidationError is the validation error returned by +// ResolveResponse.Validate if the designated constraints aren't met. +type ResolveResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResolveResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResolveResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResolveResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResolveResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResolveResponseValidationError) ErrorName() string { return "ResolveResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ResolveResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sResolveResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResolveResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResolveResponseValidationError{} + +// Validate checks the field values on SearchRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *SearchRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetWant()) < 1 { + return SearchRequestValidationError{ + field: "Want", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetQuery()) < 1 { + return SearchRequestValidationError{ + field: "Query", + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Limit + + return nil +} + +// SearchRequestValidationError is the validation error returned by +// SearchRequest.Validate if the designated constraints aren't met. +type SearchRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SearchRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SearchRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SearchRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SearchRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SearchRequestValidationError) ErrorName() string { return "SearchRequestValidationError" } + +// Error satisfies the builtin error interface +func (e SearchRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSearchRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SearchRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SearchRequestValidationError{} + +// Validate checks the field values on SearchResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *SearchResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetResults() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SearchResponseValidationError{ + field: fmt.Sprintf("Results[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetPartialFailures() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SearchResponseValidationError{ + field: fmt.Sprintf("PartialFailures[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// SearchResponseValidationError is the validation error returned by +// SearchResponse.Validate if the designated constraints aren't met. +type SearchResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SearchResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SearchResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SearchResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SearchResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SearchResponseValidationError) ErrorName() string { return "SearchResponseValidationError" } + +// Error satisfies the builtin error interface +func (e SearchResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSearchResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SearchResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SearchResponseValidationError{} + +// Validate checks the field values on GetObjectSchemasRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetObjectSchemasRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetTypeUrl()) < 1 { + return GetObjectSchemasRequestValidationError{ + field: "TypeUrl", + reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// GetObjectSchemasRequestValidationError is the validation error returned by +// GetObjectSchemasRequest.Validate if the designated constraints aren't met. +type GetObjectSchemasRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetObjectSchemasRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetObjectSchemasRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetObjectSchemasRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetObjectSchemasRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetObjectSchemasRequestValidationError) ErrorName() string { + return "GetObjectSchemasRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetObjectSchemasRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetObjectSchemasRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetObjectSchemasRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetObjectSchemasRequestValidationError{} + +// Validate checks the field values on GetObjectSchemasResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GetObjectSchemasResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TypeUrl + + for idx, item := range m.GetSchemas() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetObjectSchemasResponseValidationError{ + field: fmt.Sprintf("Schemas[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// GetObjectSchemasResponseValidationError is the validation error returned by +// GetObjectSchemasResponse.Validate if the designated constraints aren't met. +type GetObjectSchemasResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetObjectSchemasResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetObjectSchemasResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetObjectSchemasResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetObjectSchemasResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetObjectSchemasResponseValidationError) ErrorName() string { + return "GetObjectSchemasResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetObjectSchemasResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetObjectSchemasResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetObjectSchemasResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetObjectSchemasResponseValidationError{} diff --git a/backend/api/resolver/v1/schema.pb.go b/backend/api/resolver/v1/schema.pb.go new file mode 100644 index 0000000000..1d672cb962 --- /dev/null +++ b/backend/api/resolver/v1/schema.pb.go @@ -0,0 +1,727 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: resolver/v1/schema.proto + +package resolverv1 + +import ( + proto "github.com/golang/protobuf/proto" + status "google.golang.org/genproto/googleapis/rpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type StringField struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Placeholder string `protobuf:"bytes,1,opt,name=placeholder,proto3" json:"placeholder,omitempty"` + DefaultValue string `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` +} + +func (x *StringField) Reset() { + *x = StringField{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringField) ProtoMessage() {} + +func (x *StringField) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringField.ProtoReflect.Descriptor instead. +func (*StringField) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{0} +} + +func (x *StringField) GetPlaceholder() string { + if x != nil { + return x.Placeholder + } + return "" +} + +func (x *StringField) GetDefaultValue() string { + if x != nil { + return x.DefaultValue + } + return "" +} + +type Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // Types that are assignable to Value: + // *Option_StringValue + Value isOption_Value `protobuf_oneof:"value"` +} + +func (x *Option) Reset() { + *x = Option{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Option) ProtoMessage() {} + +func (x *Option) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Option.ProtoReflect.Descriptor instead. +func (*Option) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{1} +} + +func (x *Option) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (m *Option) GetValue() isOption_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Option) GetStringValue() string { + if x, ok := x.GetValue().(*Option_StringValue); ok { + return x.StringValue + } + return "" +} + +type isOption_Value interface { + isOption_Value() +} + +type Option_StringValue struct { + StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +func (*Option_StringValue) isOption_Value() {} + +type OptionField struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncludeAllOption bool `protobuf:"varint,1,opt,name=include_all_option,json=includeAllOption,proto3" json:"include_all_option,omitempty"` + IncludeDynamicOptions []string `protobuf:"bytes,2,rep,name=include_dynamic_options,json=includeDynamicOptions,proto3" json:"include_dynamic_options,omitempty"` + Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` +} + +func (x *OptionField) Reset() { + *x = OptionField{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionField) ProtoMessage() {} + +func (x *OptionField) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OptionField.ProtoReflect.Descriptor instead. +func (*OptionField) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{2} +} + +func (x *OptionField) GetIncludeAllOption() bool { + if x != nil { + return x.IncludeAllOption + } + return false +} + +func (x *OptionField) GetIncludeDynamicOptions() []string { + if x != nil { + return x.IncludeDynamicOptions + } + return nil +} + +func (x *OptionField) GetOptions() []*Option { + if x != nil { + return x.Options + } + return nil +} + +type Field struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Metadata *FieldMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{3} +} + +func (x *Field) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Field) GetMetadata() *FieldMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +type FieldMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"` + // Types that are assignable to Type: + // *FieldMetadata_StringField + // *FieldMetadata_OptionField + Type isFieldMetadata_Type `protobuf_oneof:"type"` +} + +func (x *FieldMetadata) Reset() { + *x = FieldMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldMetadata) ProtoMessage() {} + +func (x *FieldMetadata) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldMetadata.ProtoReflect.Descriptor instead. +func (*FieldMetadata) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{4} +} + +func (x *FieldMetadata) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *FieldMetadata) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +func (m *FieldMetadata) GetType() isFieldMetadata_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *FieldMetadata) GetStringField() *StringField { + if x, ok := x.GetType().(*FieldMetadata_StringField); ok { + return x.StringField + } + return nil +} + +func (x *FieldMetadata) GetOptionField() *OptionField { + if x, ok := x.GetType().(*FieldMetadata_OptionField); ok { + return x.OptionField + } + return nil +} + +type isFieldMetadata_Type interface { + isFieldMetadata_Type() +} + +type FieldMetadata_StringField struct { + StringField *StringField `protobuf:"bytes,3,opt,name=string_field,json=stringField,proto3,oneof"` +} + +type FieldMetadata_OptionField struct { + OptionField *OptionField `protobuf:"bytes,4,opt,name=option_field,json=optionField,proto3,oneof"` +} + +func (*FieldMetadata_StringField) isFieldMetadata_Type() {} + +func (*FieldMetadata_OptionField) isFieldMetadata_Type() {} + +type SchemaMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Searchable bool `protobuf:"varint,2,opt,name=searchable,proto3" json:"searchable,omitempty"` +} + +func (x *SchemaMetadata) Reset() { + *x = SchemaMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SchemaMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SchemaMetadata) ProtoMessage() {} + +func (x *SchemaMetadata) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SchemaMetadata.ProtoReflect.Descriptor instead. +func (*SchemaMetadata) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{5} +} + +func (x *SchemaMetadata) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *SchemaMetadata) GetSearchable() bool { + if x != nil { + return x.Searchable + } + return false +} + +type Schema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type URL of the object the schema was produced from, which becomes the 'have' type URL when submitting a + // filled-in schema. + TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` + Metadata *SchemaMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + Fields []*Field `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty"` + // If the schema is broken, e.g. a required option field is missing options, an error will be returned here to be + // displayed when that schema is selected. + Error *status.Status `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_resolver_v1_schema_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema) ProtoMessage() {} + +func (x *Schema) ProtoReflect() protoreflect.Message { + mi := &file_resolver_v1_schema_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_resolver_v1_schema_proto_rawDescGZIP(), []int{6} +} + +func (x *Schema) GetTypeUrl() string { + if x != nil { + return x.TypeUrl + } + return "" +} + +func (x *Schema) GetMetadata() *SchemaMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Schema) GetFields() []*Field { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Schema) GetError() *status.Status { + if x != nil { + return x.Error + } + return nil +} + +var File_resolver_v1_schema_proto protoreflect.FileDescriptor + +var file_resolver_v1_schema_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6c, 0x75, 0x74, + 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x17, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, + 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x61, + 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x59, 0x0a, + 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x0b, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x41, 0x6c, 0x6c, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x5f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x34, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5a, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x22, 0xe2, 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x00, + 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x06, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x06, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, + 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x31, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0c, 0x5a, + 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_resolver_v1_schema_proto_rawDescOnce sync.Once + file_resolver_v1_schema_proto_rawDescData = file_resolver_v1_schema_proto_rawDesc +) + +func file_resolver_v1_schema_proto_rawDescGZIP() []byte { + file_resolver_v1_schema_proto_rawDescOnce.Do(func() { + file_resolver_v1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_resolver_v1_schema_proto_rawDescData) + }) + return file_resolver_v1_schema_proto_rawDescData +} + +var file_resolver_v1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_resolver_v1_schema_proto_goTypes = []interface{}{ + (*StringField)(nil), // 0: clutch.resolver.v1.StringField + (*Option)(nil), // 1: clutch.resolver.v1.Option + (*OptionField)(nil), // 2: clutch.resolver.v1.OptionField + (*Field)(nil), // 3: clutch.resolver.v1.Field + (*FieldMetadata)(nil), // 4: clutch.resolver.v1.FieldMetadata + (*SchemaMetadata)(nil), // 5: clutch.resolver.v1.SchemaMetadata + (*Schema)(nil), // 6: clutch.resolver.v1.Schema + (*status.Status)(nil), // 7: google.rpc.Status +} +var file_resolver_v1_schema_proto_depIdxs = []int32{ + 1, // 0: clutch.resolver.v1.OptionField.options:type_name -> clutch.resolver.v1.Option + 4, // 1: clutch.resolver.v1.Field.metadata:type_name -> clutch.resolver.v1.FieldMetadata + 0, // 2: clutch.resolver.v1.FieldMetadata.string_field:type_name -> clutch.resolver.v1.StringField + 2, // 3: clutch.resolver.v1.FieldMetadata.option_field:type_name -> clutch.resolver.v1.OptionField + 5, // 4: clutch.resolver.v1.Schema.metadata:type_name -> clutch.resolver.v1.SchemaMetadata + 3, // 5: clutch.resolver.v1.Schema.fields:type_name -> clutch.resolver.v1.Field + 7, // 6: clutch.resolver.v1.Schema.error:type_name -> google.rpc.Status + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_resolver_v1_schema_proto_init() } +func file_resolver_v1_schema_proto_init() { + if File_resolver_v1_schema_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_resolver_v1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringField); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionField); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SchemaMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_resolver_v1_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_resolver_v1_schema_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Option_StringValue)(nil), + } + file_resolver_v1_schema_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*FieldMetadata_StringField)(nil), + (*FieldMetadata_OptionField)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_resolver_v1_schema_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_resolver_v1_schema_proto_goTypes, + DependencyIndexes: file_resolver_v1_schema_proto_depIdxs, + MessageInfos: file_resolver_v1_schema_proto_msgTypes, + }.Build() + File_resolver_v1_schema_proto = out.File + file_resolver_v1_schema_proto_rawDesc = nil + file_resolver_v1_schema_proto_goTypes = nil + file_resolver_v1_schema_proto_depIdxs = nil +} diff --git a/backend/api/resolver/v1/schema.pb.validate.go b/backend/api/resolver/v1/schema.pb.validate.go new file mode 100644 index 0000000000..d41a69416f --- /dev/null +++ b/backend/api/resolver/v1/schema.pb.validate.go @@ -0,0 +1,604 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: resolver/v1/schema.proto + +package resolverv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _schema_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on StringField with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *StringField) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Placeholder + + // no validation rules for DefaultValue + + return nil +} + +// StringFieldValidationError is the validation error returned by +// StringField.Validate if the designated constraints aren't met. +type StringFieldValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StringFieldValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StringFieldValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StringFieldValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StringFieldValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StringFieldValidationError) ErrorName() string { return "StringFieldValidationError" } + +// Error satisfies the builtin error interface +func (e StringFieldValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStringField.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StringFieldValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StringFieldValidationError{} + +// Validate checks the field values on Option with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Option) Validate() error { + if m == nil { + return nil + } + + // no validation rules for DisplayName + + switch m.Value.(type) { + + case *Option_StringValue: + // no validation rules for StringValue + + } + + return nil +} + +// OptionValidationError is the validation error returned by Option.Validate if +// the designated constraints aren't met. +type OptionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OptionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OptionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OptionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OptionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OptionValidationError) ErrorName() string { return "OptionValidationError" } + +// Error satisfies the builtin error interface +func (e OptionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOption.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OptionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OptionValidationError{} + +// Validate checks the field values on OptionField with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *OptionField) Validate() error { + if m == nil { + return nil + } + + // no validation rules for IncludeAllOption + + for idx, item := range m.GetOptions() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OptionFieldValidationError{ + field: fmt.Sprintf("Options[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// OptionFieldValidationError is the validation error returned by +// OptionField.Validate if the designated constraints aren't met. +type OptionFieldValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OptionFieldValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OptionFieldValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OptionFieldValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OptionFieldValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OptionFieldValidationError) ErrorName() string { return "OptionFieldValidationError" } + +// Error satisfies the builtin error interface +func (e OptionFieldValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOptionField.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OptionFieldValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OptionFieldValidationError{} + +// Validate checks the field values on Field with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Field) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FieldValidationError{ + field: "Metadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// FieldValidationError is the validation error returned by Field.Validate if +// the designated constraints aren't met. +type FieldValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FieldValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FieldValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FieldValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FieldValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FieldValidationError) ErrorName() string { return "FieldValidationError" } + +// Error satisfies the builtin error interface +func (e FieldValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sField.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FieldValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FieldValidationError{} + +// Validate checks the field values on FieldMetadata with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *FieldMetadata) Validate() error { + if m == nil { + return nil + } + + // no validation rules for DisplayName + + // no validation rules for Required + + switch m.Type.(type) { + + case *FieldMetadata_StringField: + + if v, ok := interface{}(m.GetStringField()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FieldMetadataValidationError{ + field: "StringField", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *FieldMetadata_OptionField: + + if v, ok := interface{}(m.GetOptionField()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FieldMetadataValidationError{ + field: "OptionField", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// FieldMetadataValidationError is the validation error returned by +// FieldMetadata.Validate if the designated constraints aren't met. +type FieldMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FieldMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FieldMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FieldMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FieldMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FieldMetadataValidationError) ErrorName() string { return "FieldMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e FieldMetadataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFieldMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FieldMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FieldMetadataValidationError{} + +// Validate checks the field values on SchemaMetadata with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *SchemaMetadata) Validate() error { + if m == nil { + return nil + } + + // no validation rules for DisplayName + + // no validation rules for Searchable + + return nil +} + +// SchemaMetadataValidationError is the validation error returned by +// SchemaMetadata.Validate if the designated constraints aren't met. +type SchemaMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SchemaMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SchemaMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SchemaMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SchemaMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SchemaMetadataValidationError) ErrorName() string { return "SchemaMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e SchemaMetadataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSchemaMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SchemaMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SchemaMetadataValidationError{} + +// Validate checks the field values on Schema with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Schema) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TypeUrl + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SchemaValidationError{ + field: "Metadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetFields() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SchemaValidationError{ + field: fmt.Sprintf("Fields[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SchemaValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// SchemaValidationError is the validation error returned by Schema.Validate if +// the designated constraints aren't met. +type SchemaValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SchemaValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SchemaValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SchemaValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SchemaValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SchemaValidationError) ErrorName() string { return "SchemaValidationError" } + +// Error satisfies the builtin error interface +func (e SchemaValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSchema.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SchemaValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SchemaValidationError{} diff --git a/backend/api/sourcecontrol/github/v1/github.pb.go b/backend/api/sourcecontrol/github/v1/github.pb.go new file mode 100644 index 0000000000..2afe6e6cb9 --- /dev/null +++ b/backend/api/sourcecontrol/github/v1/github.pb.go @@ -0,0 +1,549 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: sourcecontrol/github/v1/github.proto + +package githubv1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type CommitCompareStatus int32 + +const ( + CommitCompareStatus_UNSPECIFIED CommitCompareStatus = 0 + CommitCompareStatus_UNKNOWN CommitCompareStatus = 1 + CommitCompareStatus_BEHIND CommitCompareStatus = 2 + CommitCompareStatus_AHEAD CommitCompareStatus = 3 + CommitCompareStatus_IDENTICAL CommitCompareStatus = 4 +) + +// Enum value maps for CommitCompareStatus. +var ( + CommitCompareStatus_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "BEHIND", + 3: "AHEAD", + 4: "IDENTICAL", + } + CommitCompareStatus_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "BEHIND": 2, + "AHEAD": 3, + "IDENTICAL": 4, + } +) + +func (x CommitCompareStatus) Enum() *CommitCompareStatus { + p := new(CommitCompareStatus) + *p = x + return p +} + +func (x CommitCompareStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommitCompareStatus) Descriptor() protoreflect.EnumDescriptor { + return file_sourcecontrol_github_v1_github_proto_enumTypes[0].Descriptor() +} + +func (CommitCompareStatus) Type() protoreflect.EnumType { + return &file_sourcecontrol_github_v1_github_proto_enumTypes[0] +} + +func (x CommitCompareStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommitCompareStatus.Descriptor instead. +func (CommitCompareStatus) EnumDescriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{0} +} + +type RepositoryParameters_Visibility int32 + +const ( + RepositoryParameters_UNSPECIFIED RepositoryParameters_Visibility = 0 + RepositoryParameters_PUBLIC RepositoryParameters_Visibility = 1 + RepositoryParameters_PRIVATE RepositoryParameters_Visibility = 2 +) + +// Enum value maps for RepositoryParameters_Visibility. +var ( + RepositoryParameters_Visibility_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "PUBLIC", + 2: "PRIVATE", + } + RepositoryParameters_Visibility_value = map[string]int32{ + "UNSPECIFIED": 0, + "PUBLIC": 1, + "PRIVATE": 2, + } +) + +func (x RepositoryParameters_Visibility) Enum() *RepositoryParameters_Visibility { + p := new(RepositoryParameters_Visibility) + *p = x + return p +} + +func (x RepositoryParameters_Visibility) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RepositoryParameters_Visibility) Descriptor() protoreflect.EnumDescriptor { + return file_sourcecontrol_github_v1_github_proto_enumTypes[1].Descriptor() +} + +func (RepositoryParameters_Visibility) Type() protoreflect.EnumType { + return &file_sourcecontrol_github_v1_github_proto_enumTypes[1] +} + +func (x RepositoryParameters_Visibility) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RepositoryParameters_Visibility.Descriptor instead. +func (RepositoryParameters_Visibility) EnumDescriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{0, 0} +} + +// Common parameters for GitHub repostories. +type RepositoryParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Visibility RepositoryParameters_Visibility `protobuf:"varint,1,opt,name=visibility,proto3,enum=clutch.sourcecontrol.github.v1.RepositoryParameters_Visibility" json:"visibility,omitempty"` + AllowMergeCommit *wrappers.BoolValue `protobuf:"bytes,2,opt,name=allow_merge_commit,json=allowMergeCommit,proto3" json:"allow_merge_commit,omitempty"` + AllowRebaseMerge *wrappers.BoolValue `protobuf:"bytes,3,opt,name=allow_rebase_merge,json=allowRebaseMerge,proto3" json:"allow_rebase_merge,omitempty"` + AllowSquashMerge *wrappers.BoolValue `protobuf:"bytes,4,opt,name=allow_squash_merge,json=allowSquashMerge,proto3" json:"allow_squash_merge,omitempty"` +} + +func (x *RepositoryParameters) Reset() { + *x = RepositoryParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepositoryParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepositoryParameters) ProtoMessage() {} + +func (x *RepositoryParameters) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepositoryParameters.ProtoReflect.Descriptor instead. +func (*RepositoryParameters) Descriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{0} +} + +func (x *RepositoryParameters) GetVisibility() RepositoryParameters_Visibility { + if x != nil { + return x.Visibility + } + return RepositoryParameters_UNSPECIFIED +} + +func (x *RepositoryParameters) GetAllowMergeCommit() *wrappers.BoolValue { + if x != nil { + return x.AllowMergeCommit + } + return nil +} + +func (x *RepositoryParameters) GetAllowRebaseMerge() *wrappers.BoolValue { + if x != nil { + return x.AllowRebaseMerge + } + return nil +} + +func (x *RepositoryParameters) GetAllowSquashMerge() *wrappers.BoolValue { + if x != nil { + return x.AllowSquashMerge + } + return nil +} + +// Options unique to creating a repository. +type CreateRepositoryOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Parameters *RepositoryParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"` + // Pass true to create an initial commit with empty README. + AutoInit bool `protobuf:"varint,2,opt,name=auto_init,json=autoInit,proto3" json:"auto_init,omitempty"` +} + +func (x *CreateRepositoryOptions) Reset() { + *x = CreateRepositoryOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepositoryOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepositoryOptions) ProtoMessage() {} + +func (x *CreateRepositoryOptions) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepositoryOptions.ProtoReflect.Descriptor instead. +func (*CreateRepositoryOptions) Descriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateRepositoryOptions) GetParameters() *RepositoryParameters { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *CreateRepositoryOptions) GetAutoInit() bool { + if x != nil { + return x.AutoInit + } + return false +} + +// Options unique to updating a repository. +type UpdateRepositoryOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Parameters *RepositoryParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"` + // Pass true to archive this repository. Note: You cannot unarchive repositories through the API. + Archived bool `protobuf:"varint,2,opt,name=archived,proto3" json:"archived,omitempty"` +} + +func (x *UpdateRepositoryOptions) Reset() { + *x = UpdateRepositoryOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRepositoryOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRepositoryOptions) ProtoMessage() {} + +func (x *UpdateRepositoryOptions) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRepositoryOptions.ProtoReflect.Descriptor instead. +func (*UpdateRepositoryOptions) Descriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateRepositoryOptions) GetParameters() *RepositoryParameters { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *UpdateRepositoryOptions) GetArchived() bool { + if x != nil { + return x.Archived + } + return false +} + +type CommitComparison struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status CommitCompareStatus `protobuf:"varint,1,opt,name=status,proto3,enum=clutch.sourcecontrol.github.v1.CommitCompareStatus" json:"status,omitempty"` +} + +func (x *CommitComparison) Reset() { + *x = CommitComparison{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitComparison) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitComparison) ProtoMessage() {} + +func (x *CommitComparison) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_github_v1_github_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitComparison.ProtoReflect.Descriptor instead. +func (*CommitComparison) Descriptor() ([]byte, []int) { + return file_sourcecontrol_github_v1_github_proto_rawDescGZIP(), []int{3} +} + +func (x *CommitComparison) GetStatus() CommitCompareStatus { + if x != nil { + return x.Status + } + return CommitCompareStatus_UNSPECIFIED +} + +var File_sourcecontrol_github_v1_github_proto protoreflect.FileDescriptor + +var file_sourcecontrol_github_v1_github_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x99, 0x03, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x6b, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x82, 0x01, 0x04, 0x10, 0x01, 0x20, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x48, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, + 0x65, 0x72, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, + 0x48, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, + 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x5f, 0x73, 0x71, 0x75, 0x61, 0x73, 0x68, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x71, 0x75, 0x61, 0x73, 0x68, 0x4d, 0x65, + 0x72, 0x67, 0x65, 0x22, 0x36, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x01, 0x0a, 0x17, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x6c, + 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x17, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x6c, 0x75, + 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x22, 0x5f, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x63, + 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x59, 0x0a, 0x13, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x42, 0x45, 0x48, 0x49, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x48, + 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x43, + 0x41, 0x4c, 0x10, 0x04, 0x42, 0x0a, 0x5a, 0x08, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcecontrol_github_v1_github_proto_rawDescOnce sync.Once + file_sourcecontrol_github_v1_github_proto_rawDescData = file_sourcecontrol_github_v1_github_proto_rawDesc +) + +func file_sourcecontrol_github_v1_github_proto_rawDescGZIP() []byte { + file_sourcecontrol_github_v1_github_proto_rawDescOnce.Do(func() { + file_sourcecontrol_github_v1_github_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcecontrol_github_v1_github_proto_rawDescData) + }) + return file_sourcecontrol_github_v1_github_proto_rawDescData +} + +var file_sourcecontrol_github_v1_github_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_sourcecontrol_github_v1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_sourcecontrol_github_v1_github_proto_goTypes = []interface{}{ + (CommitCompareStatus)(0), // 0: clutch.sourcecontrol.github.v1.CommitCompareStatus + (RepositoryParameters_Visibility)(0), // 1: clutch.sourcecontrol.github.v1.RepositoryParameters.Visibility + (*RepositoryParameters)(nil), // 2: clutch.sourcecontrol.github.v1.RepositoryParameters + (*CreateRepositoryOptions)(nil), // 3: clutch.sourcecontrol.github.v1.CreateRepositoryOptions + (*UpdateRepositoryOptions)(nil), // 4: clutch.sourcecontrol.github.v1.UpdateRepositoryOptions + (*CommitComparison)(nil), // 5: clutch.sourcecontrol.github.v1.CommitComparison + (*wrappers.BoolValue)(nil), // 6: google.protobuf.BoolValue +} +var file_sourcecontrol_github_v1_github_proto_depIdxs = []int32{ + 1, // 0: clutch.sourcecontrol.github.v1.RepositoryParameters.visibility:type_name -> clutch.sourcecontrol.github.v1.RepositoryParameters.Visibility + 6, // 1: clutch.sourcecontrol.github.v1.RepositoryParameters.allow_merge_commit:type_name -> google.protobuf.BoolValue + 6, // 2: clutch.sourcecontrol.github.v1.RepositoryParameters.allow_rebase_merge:type_name -> google.protobuf.BoolValue + 6, // 3: clutch.sourcecontrol.github.v1.RepositoryParameters.allow_squash_merge:type_name -> google.protobuf.BoolValue + 2, // 4: clutch.sourcecontrol.github.v1.CreateRepositoryOptions.parameters:type_name -> clutch.sourcecontrol.github.v1.RepositoryParameters + 2, // 5: clutch.sourcecontrol.github.v1.UpdateRepositoryOptions.parameters:type_name -> clutch.sourcecontrol.github.v1.RepositoryParameters + 0, // 6: clutch.sourcecontrol.github.v1.CommitComparison.status:type_name -> clutch.sourcecontrol.github.v1.CommitCompareStatus + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_sourcecontrol_github_v1_github_proto_init() } +func file_sourcecontrol_github_v1_github_proto_init() { + if File_sourcecontrol_github_v1_github_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcecontrol_github_v1_github_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepositoryParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcecontrol_github_v1_github_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepositoryOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcecontrol_github_v1_github_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRepositoryOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcecontrol_github_v1_github_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitComparison); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcecontrol_github_v1_github_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcecontrol_github_v1_github_proto_goTypes, + DependencyIndexes: file_sourcecontrol_github_v1_github_proto_depIdxs, + EnumInfos: file_sourcecontrol_github_v1_github_proto_enumTypes, + MessageInfos: file_sourcecontrol_github_v1_github_proto_msgTypes, + }.Build() + File_sourcecontrol_github_v1_github_proto = out.File + file_sourcecontrol_github_v1_github_proto_rawDesc = nil + file_sourcecontrol_github_v1_github_proto_goTypes = nil + file_sourcecontrol_github_v1_github_proto_depIdxs = nil +} diff --git a/backend/api/sourcecontrol/github/v1/github.pb.validate.go b/backend/api/sourcecontrol/github/v1/github.pb.validate.go new file mode 100644 index 0000000000..6063e7c2f1 --- /dev/null +++ b/backend/api/sourcecontrol/github/v1/github.pb.validate.go @@ -0,0 +1,377 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: sourcecontrol/github/v1/github.proto + +package githubv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _github_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on RepositoryParameters with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RepositoryParameters) Validate() error { + if m == nil { + return nil + } + + if _, ok := _RepositoryParameters_Visibility_NotInLookup[m.GetVisibility()]; ok { + return RepositoryParametersValidationError{ + field: "Visibility", + reason: "value must not be in list [0]", + } + } + + if _, ok := RepositoryParameters_Visibility_name[int32(m.GetVisibility())]; !ok { + return RepositoryParametersValidationError{ + field: "Visibility", + reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetAllowMergeCommit()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RepositoryParametersValidationError{ + field: "AllowMergeCommit", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetAllowRebaseMerge()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RepositoryParametersValidationError{ + field: "AllowRebaseMerge", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetAllowSquashMerge()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RepositoryParametersValidationError{ + field: "AllowSquashMerge", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// RepositoryParametersValidationError is the validation error returned by +// RepositoryParameters.Validate if the designated constraints aren't met. +type RepositoryParametersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RepositoryParametersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RepositoryParametersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RepositoryParametersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RepositoryParametersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RepositoryParametersValidationError) ErrorName() string { + return "RepositoryParametersValidationError" +} + +// Error satisfies the builtin error interface +func (e RepositoryParametersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRepositoryParameters.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RepositoryParametersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RepositoryParametersValidationError{} + +var _RepositoryParameters_Visibility_NotInLookup = map[RepositoryParameters_Visibility]struct{}{ + 0: {}, +} + +// Validate checks the field values on CreateRepositoryOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CreateRepositoryOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetParameters()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRepositoryOptionsValidationError{ + field: "Parameters", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AutoInit + + return nil +} + +// CreateRepositoryOptionsValidationError is the validation error returned by +// CreateRepositoryOptions.Validate if the designated constraints aren't met. +type CreateRepositoryOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateRepositoryOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateRepositoryOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateRepositoryOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateRepositoryOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateRepositoryOptionsValidationError) ErrorName() string { + return "CreateRepositoryOptionsValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateRepositoryOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateRepositoryOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateRepositoryOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateRepositoryOptionsValidationError{} + +// Validate checks the field values on UpdateRepositoryOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpdateRepositoryOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetParameters()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateRepositoryOptionsValidationError{ + field: "Parameters", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Archived + + return nil +} + +// UpdateRepositoryOptionsValidationError is the validation error returned by +// UpdateRepositoryOptions.Validate if the designated constraints aren't met. +type UpdateRepositoryOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateRepositoryOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateRepositoryOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateRepositoryOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateRepositoryOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateRepositoryOptionsValidationError) ErrorName() string { + return "UpdateRepositoryOptionsValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateRepositoryOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateRepositoryOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateRepositoryOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateRepositoryOptionsValidationError{} + +// Validate checks the field values on CommitComparison with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *CommitComparison) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Status + + return nil +} + +// CommitComparisonValidationError is the validation error returned by +// CommitComparison.Validate if the designated constraints aren't met. +type CommitComparisonValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CommitComparisonValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CommitComparisonValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CommitComparisonValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CommitComparisonValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CommitComparisonValidationError) ErrorName() string { return "CommitComparisonValidationError" } + +// Error satisfies the builtin error interface +func (e CommitComparisonValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCommitComparison.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CommitComparisonValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CommitComparisonValidationError{} diff --git a/backend/api/sourcecontrol/v1/sourcecontrol.pb.go b/backend/api/sourcecontrol/v1/sourcecontrol.pb.go new file mode 100644 index 0000000000..bc509241f8 --- /dev/null +++ b/backend/api/sourcecontrol/v1/sourcecontrol.pb.go @@ -0,0 +1,406 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: sourcecontrol/v1/sourcecontrol.proto + +package sourcecontrolv1 + +import ( + context "context" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + _ "github.com/lyft/clutch/backend/api/api/v1" + v1 "github.com/lyft/clutch/backend/api/sourcecontrol/github/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type CreateRepositoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Types that are assignable to Options: + // *CreateRepositoryRequest_CustomOptions + // *CreateRepositoryRequest_GithubOptions + Options isCreateRepositoryRequest_Options `protobuf_oneof:"options"` +} + +func (x *CreateRepositoryRequest) Reset() { + *x = CreateRepositoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepositoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepositoryRequest) ProtoMessage() {} + +func (x *CreateRepositoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepositoryRequest.ProtoReflect.Descriptor instead. +func (*CreateRepositoryRequest) Descriptor() ([]byte, []int) { + return file_sourcecontrol_v1_sourcecontrol_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRepositoryRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *CreateRepositoryRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateRepositoryRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (m *CreateRepositoryRequest) GetOptions() isCreateRepositoryRequest_Options { + if m != nil { + return m.Options + } + return nil +} + +func (x *CreateRepositoryRequest) GetCustomOptions() *any.Any { + if x, ok := x.GetOptions().(*CreateRepositoryRequest_CustomOptions); ok { + return x.CustomOptions + } + return nil +} + +func (x *CreateRepositoryRequest) GetGithubOptions() *v1.CreateRepositoryOptions { + if x, ok := x.GetOptions().(*CreateRepositoryRequest_GithubOptions); ok { + return x.GithubOptions + } + return nil +} + +type isCreateRepositoryRequest_Options interface { + isCreateRepositoryRequest_Options() +} + +type CreateRepositoryRequest_CustomOptions struct { + CustomOptions *any.Any `protobuf:"bytes,4,opt,name=custom_options,json=customOptions,proto3,oneof"` +} + +type CreateRepositoryRequest_GithubOptions struct { + GithubOptions *v1.CreateRepositoryOptions `protobuf:"bytes,5,opt,name=github_options,json=githubOptions,proto3,oneof"` +} + +func (*CreateRepositoryRequest_CustomOptions) isCreateRepositoryRequest_Options() {} + +func (*CreateRepositoryRequest_GithubOptions) isCreateRepositoryRequest_Options() {} + +type CreateRepositoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *CreateRepositoryResponse) Reset() { + *x = CreateRepositoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepositoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepositoryResponse) ProtoMessage() {} + +func (x *CreateRepositoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepositoryResponse.ProtoReflect.Descriptor instead. +func (*CreateRepositoryResponse) Descriptor() ([]byte, []int) { + return file_sourcecontrol_v1_sourcecontrol_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateRepositoryResponse) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +var File_sourcecontrol_v1_sourcecontrol_proto protoreflect.FileDescriptor + +var file_sourcecontrol_v1_sourcecontrol_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, + 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xa8, 0x02, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x20, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0e, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x60, 0x0a, 0x0e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0e, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x2c, 0x0a, 0x18, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x32, 0xc1, 0x01, 0x0a, 0x10, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, 0x50, 0x49, 0x12, + 0xac, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x12, 0x30, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x27, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x01, 0x2a, 0xaa, 0xe1, 0x1c, 0x02, 0x08, 0x01, 0x42, 0x11, + 0x5a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcecontrol_v1_sourcecontrol_proto_rawDescOnce sync.Once + file_sourcecontrol_v1_sourcecontrol_proto_rawDescData = file_sourcecontrol_v1_sourcecontrol_proto_rawDesc +) + +func file_sourcecontrol_v1_sourcecontrol_proto_rawDescGZIP() []byte { + file_sourcecontrol_v1_sourcecontrol_proto_rawDescOnce.Do(func() { + file_sourcecontrol_v1_sourcecontrol_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcecontrol_v1_sourcecontrol_proto_rawDescData) + }) + return file_sourcecontrol_v1_sourcecontrol_proto_rawDescData +} + +var file_sourcecontrol_v1_sourcecontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sourcecontrol_v1_sourcecontrol_proto_goTypes = []interface{}{ + (*CreateRepositoryRequest)(nil), // 0: clutch.sourcecontrol.v1.CreateRepositoryRequest + (*CreateRepositoryResponse)(nil), // 1: clutch.sourcecontrol.v1.CreateRepositoryResponse + (*any.Any)(nil), // 2: google.protobuf.Any + (*v1.CreateRepositoryOptions)(nil), // 3: clutch.sourcecontrol.github.v1.CreateRepositoryOptions +} +var file_sourcecontrol_v1_sourcecontrol_proto_depIdxs = []int32{ + 2, // 0: clutch.sourcecontrol.v1.CreateRepositoryRequest.custom_options:type_name -> google.protobuf.Any + 3, // 1: clutch.sourcecontrol.v1.CreateRepositoryRequest.github_options:type_name -> clutch.sourcecontrol.github.v1.CreateRepositoryOptions + 0, // 2: clutch.sourcecontrol.v1.SourceControlAPI.CreateRepository:input_type -> clutch.sourcecontrol.v1.CreateRepositoryRequest + 1, // 3: clutch.sourcecontrol.v1.SourceControlAPI.CreateRepository:output_type -> clutch.sourcecontrol.v1.CreateRepositoryResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_sourcecontrol_v1_sourcecontrol_proto_init() } +func file_sourcecontrol_v1_sourcecontrol_proto_init() { + if File_sourcecontrol_v1_sourcecontrol_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepositoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepositoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_sourcecontrol_v1_sourcecontrol_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*CreateRepositoryRequest_CustomOptions)(nil), + (*CreateRepositoryRequest_GithubOptions)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcecontrol_v1_sourcecontrol_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sourcecontrol_v1_sourcecontrol_proto_goTypes, + DependencyIndexes: file_sourcecontrol_v1_sourcecontrol_proto_depIdxs, + MessageInfos: file_sourcecontrol_v1_sourcecontrol_proto_msgTypes, + }.Build() + File_sourcecontrol_v1_sourcecontrol_proto = out.File + file_sourcecontrol_v1_sourcecontrol_proto_rawDesc = nil + file_sourcecontrol_v1_sourcecontrol_proto_goTypes = nil + file_sourcecontrol_v1_sourcecontrol_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// SourceControlAPIClient is the client API for SourceControlAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SourceControlAPIClient interface { + CreateRepository(ctx context.Context, in *CreateRepositoryRequest, opts ...grpc.CallOption) (*CreateRepositoryResponse, error) +} + +type sourceControlAPIClient struct { + cc grpc.ClientConnInterface +} + +func NewSourceControlAPIClient(cc grpc.ClientConnInterface) SourceControlAPIClient { + return &sourceControlAPIClient{cc} +} + +func (c *sourceControlAPIClient) CreateRepository(ctx context.Context, in *CreateRepositoryRequest, opts ...grpc.CallOption) (*CreateRepositoryResponse, error) { + out := new(CreateRepositoryResponse) + err := c.cc.Invoke(ctx, "/clutch.sourcecontrol.v1.SourceControlAPI/CreateRepository", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SourceControlAPIServer is the server API for SourceControlAPI service. +type SourceControlAPIServer interface { + CreateRepository(context.Context, *CreateRepositoryRequest) (*CreateRepositoryResponse, error) +} + +// UnimplementedSourceControlAPIServer can be embedded to have forward compatible implementations. +type UnimplementedSourceControlAPIServer struct { +} + +func (*UnimplementedSourceControlAPIServer) CreateRepository(context.Context, *CreateRepositoryRequest) (*CreateRepositoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRepository not implemented") +} + +func RegisterSourceControlAPIServer(s *grpc.Server, srv SourceControlAPIServer) { + s.RegisterService(&_SourceControlAPI_serviceDesc, srv) +} + +func _SourceControlAPI_CreateRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRepositoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceControlAPIServer).CreateRepository(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/clutch.sourcecontrol.v1.SourceControlAPI/CreateRepository", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceControlAPIServer).CreateRepository(ctx, req.(*CreateRepositoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _SourceControlAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "clutch.sourcecontrol.v1.SourceControlAPI", + HandlerType: (*SourceControlAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRepository", + Handler: _SourceControlAPI_CreateRepository_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sourcecontrol/v1/sourcecontrol.proto", +} diff --git a/backend/api/sourcecontrol/v1/sourcecontrol.pb.gw.go b/backend/api/sourcecontrol/v1/sourcecontrol.pb.gw.go new file mode 100644 index 0000000000..4b2ac68caf --- /dev/null +++ b/backend/api/sourcecontrol/v1/sourcecontrol.pb.gw.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: sourcecontrol/v1/sourcecontrol.proto + +/* +Package sourcecontrolv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package sourcecontrolv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_SourceControlAPI_CreateRepository_0(ctx context.Context, marshaler runtime.Marshaler, client SourceControlAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRepositoryRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateRepository(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SourceControlAPI_CreateRepository_0(ctx context.Context, marshaler runtime.Marshaler, server SourceControlAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRepositoryRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateRepository(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterSourceControlAPIHandlerServer registers the http handlers for service SourceControlAPI to "mux". +// UnaryRPC :call SourceControlAPIServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSourceControlAPIHandlerFromEndpoint instead. +func RegisterSourceControlAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SourceControlAPIServer) error { + + mux.Handle("POST", pattern_SourceControlAPI_CreateRepository_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/clutch.sourcecontrol.v1.SourceControlAPI/CreateRepository") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SourceControlAPI_CreateRepository_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SourceControlAPI_CreateRepository_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterSourceControlAPIHandlerFromEndpoint is same as RegisterSourceControlAPIHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterSourceControlAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterSourceControlAPIHandler(ctx, mux, conn) +} + +// RegisterSourceControlAPIHandler registers the http handlers for service SourceControlAPI to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterSourceControlAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterSourceControlAPIHandlerClient(ctx, mux, NewSourceControlAPIClient(conn)) +} + +// RegisterSourceControlAPIHandlerClient registers the http handlers for service SourceControlAPI +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SourceControlAPIClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SourceControlAPIClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "SourceControlAPIClient" to call the correct interceptors. +func RegisterSourceControlAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SourceControlAPIClient) error { + + mux.Handle("POST", pattern_SourceControlAPI_CreateRepository_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/clutch.sourcecontrol.v1.SourceControlAPI/CreateRepository") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SourceControlAPI_CreateRepository_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SourceControlAPI_CreateRepository_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_SourceControlAPI_CreateRepository_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sourcecontrol", "createRepository"}, "")) +) + +var ( + forward_SourceControlAPI_CreateRepository_0 = runtime.ForwardResponseMessage +) diff --git a/backend/api/sourcecontrol/v1/sourcecontrol.pb.validate.go b/backend/api/sourcecontrol/v1/sourcecontrol.pb.validate.go new file mode 100644 index 0000000000..43dbc13886 --- /dev/null +++ b/backend/api/sourcecontrol/v1/sourcecontrol.pb.validate.go @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: sourcecontrol/v1/sourcecontrol.proto + +package sourcecontrolv1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _sourcecontrol_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on CreateRepositoryRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CreateRepositoryRequest) Validate() error { + if m == nil { + return nil + } + + if len(m.GetOwner()) < 1 { + return CreateRepositoryRequestValidationError{ + field: "Owner", + reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return CreateRepositoryRequestValidationError{ + field: "Name", + reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Description + + switch m.Options.(type) { + + case *CreateRepositoryRequest_CustomOptions: + + if v, ok := interface{}(m.GetCustomOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRepositoryRequestValidationError{ + field: "CustomOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *CreateRepositoryRequest_GithubOptions: + + if v, ok := interface{}(m.GetGithubOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRepositoryRequestValidationError{ + field: "GithubOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + return CreateRepositoryRequestValidationError{ + field: "Options", + reason: "value is required", + } + + } + + return nil +} + +// CreateRepositoryRequestValidationError is the validation error returned by +// CreateRepositoryRequest.Validate if the designated constraints aren't met. +type CreateRepositoryRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateRepositoryRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateRepositoryRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateRepositoryRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateRepositoryRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateRepositoryRequestValidationError) ErrorName() string { + return "CreateRepositoryRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateRepositoryRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateRepositoryRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateRepositoryRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateRepositoryRequestValidationError{} + +// Validate checks the field values on CreateRepositoryResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CreateRepositoryResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Url + + return nil +} + +// CreateRepositoryResponseValidationError is the validation error returned by +// CreateRepositoryResponse.Validate if the designated constraints aren't met. +type CreateRepositoryResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateRepositoryResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateRepositoryResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateRepositoryResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateRepositoryResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateRepositoryResponseValidationError) ErrorName() string { + return "CreateRepositoryResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateRepositoryResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateRepositoryResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateRepositoryResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateRepositoryResponseValidationError{} diff --git a/backend/api/topology/v1/topology_api.pb.go b/backend/api/topology/v1/topology_api.pb.go new file mode 100644 index 0000000000..80737ce810 --- /dev/null +++ b/backend/api/topology/v1/topology_api.pb.go @@ -0,0 +1,1470 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: topology/v1/topology_api.proto + +package topologyv1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + _struct "github.com/golang/protobuf/ptypes/struct" + _ "github.com/lyft/clutch/backend/api/api/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + status "google.golang.org/genproto/googleapis/rpc/status" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status1 "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Constraint_Operator int32 + +const ( + Constraint_UNSPECIFIED Constraint_Operator = 0 + // number operators + Constraint_EQUAL Constraint_Operator = 1 + Constraint_NOT_EQUAL Constraint_Operator = 2 + Constraint_GREATER_THAN Constraint_Operator = 3 + Constraint_GREATER_THAN_OR_EQUAL Constraint_Operator = 4 + Constraint_LESS_THAN Constraint_Operator = 5 + Constraint_LESS_THAN_OR_EQUAL Constraint_Operator = 6 + // string operators + Constraint_CONTAINS_STRING Constraint_Operator = 7 + // array operators + Constraint_CONTAINS_VALUE Constraint_Operator = 8 + // map operators + Constraint_CONTAINS_KEY Constraint_Operator = 9 +) + +// Enum value maps for Constraint_Operator. +var ( + Constraint_Operator_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "EQUAL", + 2: "NOT_EQUAL", + 3: "GREATER_THAN", + 4: "GREATER_THAN_OR_EQUAL", + 5: "LESS_THAN", + 6: "LESS_THAN_OR_EQUAL", + 7: "CONTAINS_STRING", + 8: "CONTAINS_VALUE", + 9: "CONTAINS_KEY", + } + Constraint_Operator_value = map[string]int32{ + "UNSPECIFIED": 0, + "EQUAL": 1, + "NOT_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "LESS_THAN": 5, + "LESS_THAN_OR_EQUAL": 6, + "CONTAINS_STRING": 7, + "CONTAINS_VALUE": 8, + "CONTAINS_KEY": 9, + } +) + +func (x Constraint_Operator) Enum() *Constraint_Operator { + p := new(Constraint_Operator) + *p = x + return p +} + +func (x Constraint_Operator) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Constraint_Operator) Descriptor() protoreflect.EnumDescriptor { + return file_topology_v1_topology_api_proto_enumTypes[0].Descriptor() +} + +func (Constraint_Operator) Type() protoreflect.EnumType { + return &file_topology_v1_topology_api_proto_enumTypes[0] +} + +func (x Constraint_Operator) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Constraint_Operator.Descriptor instead. +func (Constraint_Operator) EnumDescriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{3, 0} +} + +// if aggregate, then all timeseries or array metadata is aggregated into a +// value and returned otherwise, it will return the original array/timeseries. +// This is meant to reduce message size for larger queries. +type MetadataQuery_Aggregation int32 + +const ( + // default; no aggregation applied + MetadataQuery_UNSPECIFIED MetadataQuery_Aggregation = 0 + MetadataQuery_SUM MetadataQuery_Aggregation = 1 + MetadataQuery_AVERAGE MetadataQuery_Aggregation = 2 + MetadataQuery_MEDIAN MetadataQuery_Aggregation = 3 + MetadataQuery_MODE MetadataQuery_Aggregation = 4 + MetadataQuery_MIN MetadataQuery_Aggregation = 5 + MetadataQuery_MAX MetadataQuery_Aggregation = 6 + MetadataQuery_COUNT MetadataQuery_Aggregation = 7 +) + +// Enum value maps for MetadataQuery_Aggregation. +var ( + MetadataQuery_Aggregation_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "SUM", + 2: "AVERAGE", + 3: "MEDIAN", + 4: "MODE", + 5: "MIN", + 6: "MAX", + 7: "COUNT", + } + MetadataQuery_Aggregation_value = map[string]int32{ + "UNSPECIFIED": 0, + "SUM": 1, + "AVERAGE": 2, + "MEDIAN": 3, + "MODE": 4, + "MIN": 5, + "MAX": 6, + "COUNT": 7, + } +) + +func (x MetadataQuery_Aggregation) Enum() *MetadataQuery_Aggregation { + p := new(MetadataQuery_Aggregation) + *p = x + return p +} + +func (x MetadataQuery_Aggregation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetadataQuery_Aggregation) Descriptor() protoreflect.EnumDescriptor { + return file_topology_v1_topology_api_proto_enumTypes[1].Descriptor() +} + +func (MetadataQuery_Aggregation) Type() protoreflect.EnumType { + return &file_topology_v1_topology_api_proto_enumTypes[1] +} + +func (x MetadataQuery_Aggregation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MetadataQuery_Aggregation.Descriptor instead. +func (MetadataQuery_Aggregation) EnumDescriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{4, 0} +} + +// Action signifies to the topology service what to do with an incoming topology Resource +// +// The topology service gets a topology Resource off of the `GetTopologyObjectChannel` which is processed +// and stored in the topology_cache table. +type UpdateCacheRequest_Action int32 + +const ( + UpdateCacheRequest_UNSPECIFIED UpdateCacheRequest_Action = 0 + UpdateCacheRequest_CREATE_OR_UPDATE UpdateCacheRequest_Action = 1 + UpdateCacheRequest_DELETE UpdateCacheRequest_Action = 2 +) + +// Enum value maps for UpdateCacheRequest_Action. +var ( + UpdateCacheRequest_Action_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "CREATE_OR_UPDATE", + 2: "DELETE", + } + UpdateCacheRequest_Action_value = map[string]int32{ + "UNSPECIFIED": 0, + "CREATE_OR_UPDATE": 1, + "DELETE": 2, + } +) + +func (x UpdateCacheRequest_Action) Enum() *UpdateCacheRequest_Action { + p := new(UpdateCacheRequest_Action) + *p = x + return p +} + +func (x UpdateCacheRequest_Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UpdateCacheRequest_Action) Descriptor() protoreflect.EnumDescriptor { + return file_topology_v1_topology_api_proto_enumTypes[2].Descriptor() +} + +func (UpdateCacheRequest_Action) Type() protoreflect.EnumType { + return &file_topology_v1_topology_api_proto_enumTypes[2] +} + +func (x UpdateCacheRequest_Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UpdateCacheRequest_Action.Descriptor instead. +func (UpdateCacheRequest_Action) EnumDescriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{10, 0} +} + +type GetTopologyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Queries []*Query `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries,omitempty"` +} + +func (x *GetTopologyRequest) Reset() { + *x = GetTopologyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_topology_v1_topology_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTopologyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTopologyRequest) ProtoMessage() {} + +func (x *GetTopologyRequest) ProtoReflect() protoreflect.Message { + mi := &file_topology_v1_topology_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTopologyRequest.ProtoReflect.Descriptor instead. +func (*GetTopologyRequest) Descriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{0} +} + +func (x *GetTopologyRequest) GetQueries() []*Query { + if x != nil { + return x.Queries + } + return nil +} + +type GetTopologyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *GetTopologyResponse) Reset() { + *x = GetTopologyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_topology_v1_topology_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTopologyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTopologyResponse) ProtoMessage() {} + +func (x *GetTopologyResponse) ProtoReflect() protoreflect.Message { + mi := &file_topology_v1_topology_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTopologyResponse.ProtoReflect.Descriptor instead. +func (*GetTopologyResponse) Descriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{1} +} + +func (x *GetTopologyResponse) GetResults() []*QueryResult { + if x != nil { + return x.Results + } + return nil +} + +// A query allows the user to specify multiple dimensions and the +// corresponding desired values for the identifying features of the returned +// nodes. +type FeatureQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *FeatureQuery) Reset() { + *x = FeatureQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_topology_v1_topology_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureQuery) ProtoMessage() {} + +func (x *FeatureQuery) ProtoReflect() protoreflect.Message { + mi := &file_topology_v1_topology_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureQuery.ProtoReflect.Descriptor instead. +func (*FeatureQuery) Descriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{2} +} + +func (x *FeatureQuery) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FeatureQuery) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +// A metadata constraint with an operator and a value +type Constraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Operator Constraint_Operator `protobuf:"varint,1,opt,name=operator,proto3,enum=clutch.topology.v1.Constraint_Operator" json:"operator,omitempty"` + Value *_struct.Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Constraint) Reset() { + *x = Constraint{} + if protoimpl.UnsafeEnabled { + mi := &file_topology_v1_topology_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Constraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Constraint) ProtoMessage() {} + +func (x *Constraint) ProtoReflect() protoreflect.Message { + mi := &file_topology_v1_topology_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Constraint.ProtoReflect.Descriptor instead. +func (*Constraint) Descriptor() ([]byte, []int) { + return file_topology_v1_topology_api_proto_rawDescGZIP(), []int{3} +} + +func (x *Constraint) GetOperator() Constraint_Operator { + if x != nil { + return x.Operator + } + return Constraint_UNSPECIFIED +} + +func (x *Constraint) GetValue() *_struct.Value { + if x != nil { + return x.Value + } + return nil +} + +// Similar to FeatureQuery, rather than pre-traversal filtering, +// MetadataQuery specifies metadata params and potential filters +// for nodes and edges +type MetadataQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // name of the metadata field to populate. i.e. call_volume, service_tier, + // etc. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // i.e. Wavefront params: google.protobuf.Struct{ ...start: