diff --git a/protobuf/configpb/config.pb.go b/protobuf/configpb/config.pb.go new file mode 100644 index 0000000..0a3d345 --- /dev/null +++ b/protobuf/configpb/config.pb.go @@ -0,0 +1,467 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.2 +// source: github.com/dogmatiq/enginekit/protobuf/configpb/config.proto + +package configpb + +import ( + identitypb "github.com/dogmatiq/enginekit/protobuf/identitypb" + 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) +) + +// MessageKind is an enumeration of the kinds of message, represented by the +// [dogma.Command], [dogma.Event], and [dogma.Timeout] interfaces. +type MessageKind int32 + +const ( + MessageKind_UNKNOWN_MESSAGE_KIND MessageKind = 0 + MessageKind_COMMAND MessageKind = 1 + MessageKind_EVENT MessageKind = 2 + MessageKind_TIMEOUT MessageKind = 3 +) + +// Enum value maps for MessageKind. +var ( + MessageKind_name = map[int32]string{ + 0: "UNKNOWN_MESSAGE_KIND", + 1: "COMMAND", + 2: "EVENT", + 3: "TIMEOUT", + } + MessageKind_value = map[string]int32{ + "UNKNOWN_MESSAGE_KIND": 0, + "COMMAND": 1, + "EVENT": 2, + "TIMEOUT": 3, + } +) + +func (x MessageKind) Enum() *MessageKind { + p := new(MessageKind) + *p = x + return p +} + +func (x MessageKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MessageKind) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes[0].Descriptor() +} + +func (MessageKind) Type() protoreflect.EnumType { + return &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes[0] +} + +func (x MessageKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MessageKind.Descriptor instead. +func (MessageKind) EnumDescriptor() ([]byte, []int) { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescGZIP(), []int{0} +} + +// HandlerType is an enumeration of the types of handlers that an application +// can contain. +type HandlerType int32 + +const ( + HandlerType_UNKNOWN_HANDLER_TYPE HandlerType = 0 + HandlerType_AGGREGATE HandlerType = 1 + HandlerType_PROCESS HandlerType = 2 + HandlerType_INTEGRATION HandlerType = 3 + HandlerType_PROJECTION HandlerType = 4 +) + +// Enum value maps for HandlerType. +var ( + HandlerType_name = map[int32]string{ + 0: "UNKNOWN_HANDLER_TYPE", + 1: "AGGREGATE", + 2: "PROCESS", + 3: "INTEGRATION", + 4: "PROJECTION", + } + HandlerType_value = map[string]int32{ + "UNKNOWN_HANDLER_TYPE": 0, + "AGGREGATE": 1, + "PROCESS": 2, + "INTEGRATION": 3, + "PROJECTION": 4, + } +) + +func (x HandlerType) Enum() *HandlerType { + p := new(HandlerType) + *p = x + return p +} + +func (x HandlerType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HandlerType) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes[1].Descriptor() +} + +func (HandlerType) Type() protoreflect.EnumType { + return &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes[1] +} + +func (x HandlerType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HandlerType.Descriptor instead. +func (HandlerType) EnumDescriptor() ([]byte, []int) { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescGZIP(), []int{1} +} + +// Application represents a Dogma application hosted by the engine on the +// server. +type Application struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identity is the application's identity. + Identity *identitypb.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + // GoType is the fully-qualified name of the Go type that provides as the + // application's implementation. + GoType string `protobuf:"bytes,2,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"` + // Handlers is the set of handlers within the application. + Handlers []*Handler `protobuf:"bytes,3,rep,name=handlers,proto3" json:"handlers,omitempty"` +} + +func (x *Application) Reset() { + *x = Application{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Application) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Application) ProtoMessage() {} + +func (x *Application) ProtoReflect() protoreflect.Message { + mi := &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_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 Application.ProtoReflect.Descriptor instead. +func (*Application) Descriptor() ([]byte, []int) { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescGZIP(), []int{0} +} + +func (x *Application) GetIdentity() *identitypb.Identity { + if x != nil { + return x.Identity + } + return nil +} + +func (x *Application) GetGoType() string { + if x != nil { + return x.GoType + } + return "" +} + +func (x *Application) GetHandlers() []*Handler { + if x != nil { + return x.Handlers + } + return nil +} + +// Handler is a message handler within an application. +type Handler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identity is the handler's identity. + Identity *identitypb.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + // GoType is the fully-qualified name of the Go type that provides as the + // handler's implementation. + GoType string `protobuf:"bytes,2,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"` + // Type is the handler's type. + Type HandlerType `protobuf:"varint,3,opt,name=type,proto3,enum=dogma.protobuf.HandlerType" json:"type,omitempty"` + // ProducedMessages is the set of messages produced by this handler. + // + // The keys are the fully-qualified names of the message's Go type and the + // value is the kind of message implemented by that type. + ProducedMessages map[string]MessageKind `protobuf:"bytes,4,rep,name=produced_messages,json=producedMessages,proto3" json:"produced_messages,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=dogma.protobuf.MessageKind"` + // ConsumedMessages is the set of messages consumed by this handler. + // + // The keys are the fully-qualified names of the message's Go type and the + // value is the kind of message implemented by that type. + ConsumedMessages map[string]MessageKind `protobuf:"bytes,5,rep,name=consumed_messages,json=consumedMessages,proto3" json:"consumed_messages,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=dogma.protobuf.MessageKind"` + // IsDisabled indicates whether the handler is disabled. + IsDisabled bool `protobuf:"varint,6,opt,name=is_disabled,json=isDisabled,proto3" json:"is_disabled,omitempty"` +} + +func (x *Handler) Reset() { + *x = Handler{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Handler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Handler) ProtoMessage() {} + +func (x *Handler) ProtoReflect() protoreflect.Message { + mi := &file_github_com_dogmatiq_enginekit_protobuf_configpb_config_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 Handler.ProtoReflect.Descriptor instead. +func (*Handler) Descriptor() ([]byte, []int) { + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescGZIP(), []int{1} +} + +func (x *Handler) GetIdentity() *identitypb.Identity { + if x != nil { + return x.Identity + } + return nil +} + +func (x *Handler) GetGoType() string { + if x != nil { + return x.GoType + } + return "" +} + +func (x *Handler) GetType() HandlerType { + if x != nil { + return x.Type + } + return HandlerType_UNKNOWN_HANDLER_TYPE +} + +func (x *Handler) GetProducedMessages() map[string]MessageKind { + if x != nil { + return x.ProducedMessages + } + return nil +} + +func (x *Handler) GetConsumedMessages() map[string]MessageKind { + if x != nil { + return x.ConsumedMessages + } + return nil +} + +func (x *Handler) GetIsDisabled() bool { + if x != nil { + return x.IsDisabled + } + return false +} + +var File_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto protoreflect.FileDescriptor + +var file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDesc = []byte{ + 0x0a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x67, + 0x6d, 0x61, 0x74, 0x69, 0x71, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x6b, 0x69, 0x74, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x70, + 0x62, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, + 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x1a, 0x40, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x67, 0x6d, 0x61, + 0x74, 0x69, 0x71, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x70, + 0x62, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x34, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x33, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x73, 0x22, 0xa6, 0x04, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x12, 0x34, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x2f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, + 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x5a, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x6f, + 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x5a, 0x0a, 0x11, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, + 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x60, 0x0a, 0x15, 0x50, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4b, 0x69, 0x6e, 0x64, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, 0x0a, 0x15, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4b, 0x69, + 0x6e, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x4c, 0x0a, + 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x14, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, + 0x4b, 0x49, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, + 0x44, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0b, + 0x0a, 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x03, 0x2a, 0x64, 0x0a, 0x0b, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, + 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, 0x10, 0x02, + 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x04, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x6f, 0x67, 0x6d, 0x61, 0x74, 0x69, 0x71, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x6b, + 0x69, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescOnce sync.Once + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescData = file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDesc +) + +func file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescGZIP() []byte { + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescOnce.Do(func() { + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescData) + }) + return file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDescData +} + +var file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_goTypes = []any{ + (MessageKind)(0), // 0: dogma.protobuf.MessageKind + (HandlerType)(0), // 1: dogma.protobuf.HandlerType + (*Application)(nil), // 2: dogma.protobuf.Application + (*Handler)(nil), // 3: dogma.protobuf.Handler + nil, // 4: dogma.protobuf.Handler.ProducedMessagesEntry + nil, // 5: dogma.protobuf.Handler.ConsumedMessagesEntry + (*identitypb.Identity)(nil), // 6: dogma.protobuf.Identity +} +var file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_depIdxs = []int32{ + 6, // 0: dogma.protobuf.Application.identity:type_name -> dogma.protobuf.Identity + 3, // 1: dogma.protobuf.Application.handlers:type_name -> dogma.protobuf.Handler + 6, // 2: dogma.protobuf.Handler.identity:type_name -> dogma.protobuf.Identity + 1, // 3: dogma.protobuf.Handler.type:type_name -> dogma.protobuf.HandlerType + 4, // 4: dogma.protobuf.Handler.produced_messages:type_name -> dogma.protobuf.Handler.ProducedMessagesEntry + 5, // 5: dogma.protobuf.Handler.consumed_messages:type_name -> dogma.protobuf.Handler.ConsumedMessagesEntry + 0, // 6: dogma.protobuf.Handler.ProducedMessagesEntry.value:type_name -> dogma.protobuf.MessageKind + 0, // 7: dogma.protobuf.Handler.ConsumedMessagesEntry.value:type_name -> dogma.protobuf.MessageKind + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] 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_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_init() } +func file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_init() { + if File_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Application); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Handler); 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_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_goTypes, + DependencyIndexes: file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_depIdxs, + EnumInfos: file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_enumTypes, + MessageInfos: file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_msgTypes, + }.Build() + File_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto = out.File + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_rawDesc = nil + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_goTypes = nil + file_github_com_dogmatiq_enginekit_protobuf_configpb_config_proto_depIdxs = nil +} diff --git a/protobuf/configpb/config.proto b/protobuf/configpb/config.proto new file mode 100644 index 0000000..c0cfd44 --- /dev/null +++ b/protobuf/configpb/config.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package dogma.protobuf; + +option go_package = "github.com/dogmatiq/enginekit/protobuf/configpb"; + +import "github.com/dogmatiq/enginekit/protobuf/identitypb/identity.proto"; + +// MessageKind is an enumeration of the kinds of message, represented by the +// [dogma.Command], [dogma.Event], and [dogma.Timeout] interfaces. +enum MessageKind { + UNKNOWN_MESSAGE_KIND = 0; + COMMAND = 1; + EVENT = 2; + TIMEOUT = 3; +} + +// HandlerType is an enumeration of the types of handlers that an application +// can contain. +enum HandlerType { + UNKNOWN_HANDLER_TYPE = 0; + AGGREGATE = 1; + PROCESS = 2; + INTEGRATION = 3; + PROJECTION = 4; +} + +// Application represents a Dogma application hosted by the engine on the +// server. +message Application { + // Identity is the application's identity. + Identity identity = 1; + + // GoType is the fully-qualified name of the Go type that provides as the + // application's implementation. + string go_type = 2; + + // Handlers is the set of handlers within the application. + repeated Handler handlers = 3; +} + +// Handler is a message handler within an application. +message Handler { + // Identity is the handler's identity. + Identity identity = 1; + + // GoType is the fully-qualified name of the Go type that provides as the + // handler's implementation. + string go_type = 2; + + // Type is the handler's type. + HandlerType type = 3; + + // ProducedMessages is the set of messages produced by this handler. + // + // The keys are the fully-qualified names of the message's Go type and the + // value is the kind of message implemented by that type. + map produced_messages = 4; + + // ConsumedMessages is the set of messages consumed by this handler. + // + // The keys are the fully-qualified names of the message's Go type and the + // value is the kind of message implemented by that type. + map consumed_messages = 5; + + // IsDisabled indicates whether the handler is disabled. + bool is_disabled = 6; +} diff --git a/protobuf/configpb/config_primo.pb.go b/protobuf/configpb/config_primo.pb.go new file mode 100644 index 0000000..04b1a0d --- /dev/null +++ b/protobuf/configpb/config_primo.pb.go @@ -0,0 +1,333 @@ +// Code generated by protoc-gen-go-primo. DO NOT EDIT. +// versions: +// protoc-gen-go-primo v +// protoc v5.27.2 +// source: github.com/dogmatiq/enginekit/protobuf/configpb/config.proto + +package configpb + +import ( + "fmt" + identitypb "github.com/dogmatiq/enginekit/protobuf/identitypb" +) + +type ApplicationBuilder struct { + prototype Application +} + +// NewApplicationBuilder returns a builder that constructs [Application] messages. +func NewApplicationBuilder() *ApplicationBuilder { + return &ApplicationBuilder{} +} + +// From configures the builder to use x as the prototype for new messages, +// then returns b. +// +// It performs a shallow copy of x, such that any changes made via the builder +// do not modify x. It does not make a copy of the field values themselves. +func (b *ApplicationBuilder) From(x *Application) *ApplicationBuilder { + b.prototype.Identity = x.Identity + b.prototype.GoType = x.GoType + b.prototype.Handlers = x.Handlers + return b +} + +// Build returns a new [Application] containing the values configured via the builder. +// +// Each call returns a new message, such that future changes to the builder do +// not modify previously constructed messages. +func (b *ApplicationBuilder) Build() *Application { + return &Application{ + Identity: b.prototype.Identity, + GoType: b.prototype.GoType, + Handlers: b.prototype.Handlers, + } +} + +// WithIdentity configures the builder to set the Identity field to v, +// then returns b. +func (b *ApplicationBuilder) WithIdentity(v *identitypb.Identity) *ApplicationBuilder { + b.prototype.Identity = v + return b +} + +// WithGoType configures the builder to set the GoType field to v, +// then returns b. +func (b *ApplicationBuilder) WithGoType(v string) *ApplicationBuilder { + b.prototype.GoType = v + return b +} + +// WithHandlers configures the builder to set the Handlers field to v, +// then returns b. +func (b *ApplicationBuilder) WithHandlers(v []*Handler) *ApplicationBuilder { + b.prototype.Handlers = v + return b +} + +type HandlerBuilder struct { + prototype Handler +} + +// NewHandlerBuilder returns a builder that constructs [Handler] messages. +func NewHandlerBuilder() *HandlerBuilder { + return &HandlerBuilder{} +} + +// From configures the builder to use x as the prototype for new messages, +// then returns b. +// +// It performs a shallow copy of x, such that any changes made via the builder +// do not modify x. It does not make a copy of the field values themselves. +func (b *HandlerBuilder) From(x *Handler) *HandlerBuilder { + b.prototype.Identity = x.Identity + b.prototype.GoType = x.GoType + b.prototype.Type = x.Type + b.prototype.ProducedMessages = x.ProducedMessages + b.prototype.ConsumedMessages = x.ConsumedMessages + b.prototype.IsDisabled = x.IsDisabled + return b +} + +// Build returns a new [Handler] containing the values configured via the builder. +// +// Each call returns a new message, such that future changes to the builder do +// not modify previously constructed messages. +func (b *HandlerBuilder) Build() *Handler { + return &Handler{ + Identity: b.prototype.Identity, + GoType: b.prototype.GoType, + Type: b.prototype.Type, + ProducedMessages: b.prototype.ProducedMessages, + ConsumedMessages: b.prototype.ConsumedMessages, + IsDisabled: b.prototype.IsDisabled, + } +} + +// WithIdentity configures the builder to set the Identity field to v, +// then returns b. +func (b *HandlerBuilder) WithIdentity(v *identitypb.Identity) *HandlerBuilder { + b.prototype.Identity = v + return b +} + +// WithGoType configures the builder to set the GoType field to v, +// then returns b. +func (b *HandlerBuilder) WithGoType(v string) *HandlerBuilder { + b.prototype.GoType = v + return b +} + +// WithType configures the builder to set the Type field to v, +// then returns b. +func (b *HandlerBuilder) WithType(v HandlerType) *HandlerBuilder { + b.prototype.Type = v + return b +} + +// WithProducedMessages configures the builder to set the ProducedMessages field to v, +// then returns b. +func (b *HandlerBuilder) WithProducedMessages(v map[string]MessageKind) *HandlerBuilder { + b.prototype.ProducedMessages = v + return b +} + +// WithConsumedMessages configures the builder to set the ConsumedMessages field to v, +// then returns b. +func (b *HandlerBuilder) WithConsumedMessages(v map[string]MessageKind) *HandlerBuilder { + b.prototype.ConsumedMessages = v + return b +} + +// WithIsDisabled configures the builder to set the IsDisabled field to v, +// then returns b. +func (b *HandlerBuilder) WithIsDisabled(v bool) *HandlerBuilder { + b.prototype.IsDisabled = v + return b +} + +type ( + // MessageKind_UNKNOWN_MESSAGE_KIND_Case is a type that statically associates a function + // with a [MessageKind_UNKNOWN_MESSAGE_KIND] value. + MessageKind_UNKNOWN_MESSAGE_KIND_Case struct{} + // MessageKind_COMMAND_Case is a type that statically associates a function + // with a [MessageKind_COMMAND] value. + MessageKind_COMMAND_Case struct{} + // MessageKind_EVENT_Case is a type that statically associates a function + // with a [MessageKind_EVENT] value. + MessageKind_EVENT_Case struct{} + // MessageKind_TIMEOUT_Case is a type that statically associates a function + // with a [MessageKind_TIMEOUT] value. + MessageKind_TIMEOUT_Case struct{} +) + +// Switch_MessageKind dispatches to a function based on the value of v. +// +// It invokes the function that corresponds to v. It panics if v is not a +// recognized [MessageKind] value. +func Switch_MessageKind( + v MessageKind, + caseUNKNOWN_MESSAGE_KIND func(MessageKind_UNKNOWN_MESSAGE_KIND_Case), + caseCOMMAND func(MessageKind_COMMAND_Case), + caseEVENT func(MessageKind_EVENT_Case), + caseTIMEOUT func(MessageKind_TIMEOUT_Case), +) { + switch v { + case MessageKind_UNKNOWN_MESSAGE_KIND: + caseUNKNOWN_MESSAGE_KIND(MessageKind_UNKNOWN_MESSAGE_KIND_Case{}) + case MessageKind_COMMAND: + caseCOMMAND(MessageKind_COMMAND_Case{}) + case MessageKind_EVENT: + caseEVENT(MessageKind_EVENT_Case{}) + case MessageKind_TIMEOUT: + caseTIMEOUT(MessageKind_TIMEOUT_Case{}) + default: + panic(fmt.Sprintf("Switch_MessageKind: %d is not a valid MessageKind", v)) + } +} + +// Map_MessageKind maps a member of the [MessageKind] enumeration to a +// value of type T. +// +// It invokes the function that corresponds to v, and returns that function's +// result. It panics if v is not a recognized [MessageKind] value. +func Map_MessageKind[T any]( + v MessageKind, + caseUNKNOWN_MESSAGE_KIND func(MessageKind_UNKNOWN_MESSAGE_KIND_Case) T, + caseCOMMAND func(MessageKind_COMMAND_Case) T, + caseEVENT func(MessageKind_EVENT_Case) T, + caseTIMEOUT func(MessageKind_TIMEOUT_Case) T, +) T { + switch v { + case MessageKind_UNKNOWN_MESSAGE_KIND: + return caseUNKNOWN_MESSAGE_KIND(MessageKind_UNKNOWN_MESSAGE_KIND_Case{}) + case MessageKind_COMMAND: + return caseCOMMAND(MessageKind_COMMAND_Case{}) + case MessageKind_EVENT: + return caseEVENT(MessageKind_EVENT_Case{}) + case MessageKind_TIMEOUT: + return caseTIMEOUT(MessageKind_TIMEOUT_Case{}) + default: + panic(fmt.Sprintf("Map_MessageKind: %d is not a valid MessageKind", v)) + } +} + +type ( + // HandlerType_UNKNOWN_HANDLER_TYPE_Case is a type that statically associates a function + // with a [HandlerType_UNKNOWN_HANDLER_TYPE] value. + HandlerType_UNKNOWN_HANDLER_TYPE_Case struct{} + // HandlerType_AGGREGATE_Case is a type that statically associates a function + // with a [HandlerType_AGGREGATE] value. + HandlerType_AGGREGATE_Case struct{} + // HandlerType_PROCESS_Case is a type that statically associates a function + // with a [HandlerType_PROCESS] value. + HandlerType_PROCESS_Case struct{} + // HandlerType_INTEGRATION_Case is a type that statically associates a function + // with a [HandlerType_INTEGRATION] value. + HandlerType_INTEGRATION_Case struct{} + // HandlerType_PROJECTION_Case is a type that statically associates a function + // with a [HandlerType_PROJECTION] value. + HandlerType_PROJECTION_Case struct{} +) + +// Switch_HandlerType dispatches to a function based on the value of v. +// +// It invokes the function that corresponds to v. It panics if v is not a +// recognized [HandlerType] value. +func Switch_HandlerType( + v HandlerType, + caseUNKNOWN_HANDLER_TYPE func(HandlerType_UNKNOWN_HANDLER_TYPE_Case), + caseAGGREGATE func(HandlerType_AGGREGATE_Case), + casePROCESS func(HandlerType_PROCESS_Case), + caseINTEGRATION func(HandlerType_INTEGRATION_Case), + casePROJECTION func(HandlerType_PROJECTION_Case), +) { + switch v { + case HandlerType_UNKNOWN_HANDLER_TYPE: + caseUNKNOWN_HANDLER_TYPE(HandlerType_UNKNOWN_HANDLER_TYPE_Case{}) + case HandlerType_AGGREGATE: + caseAGGREGATE(HandlerType_AGGREGATE_Case{}) + case HandlerType_PROCESS: + casePROCESS(HandlerType_PROCESS_Case{}) + case HandlerType_INTEGRATION: + caseINTEGRATION(HandlerType_INTEGRATION_Case{}) + case HandlerType_PROJECTION: + casePROJECTION(HandlerType_PROJECTION_Case{}) + default: + panic(fmt.Sprintf("Switch_HandlerType: %d is not a valid HandlerType", v)) + } +} + +// Map_HandlerType maps a member of the [HandlerType] enumeration to a +// value of type T. +// +// It invokes the function that corresponds to v, and returns that function's +// result. It panics if v is not a recognized [HandlerType] value. +func Map_HandlerType[T any]( + v HandlerType, + caseUNKNOWN_HANDLER_TYPE func(HandlerType_UNKNOWN_HANDLER_TYPE_Case) T, + caseAGGREGATE func(HandlerType_AGGREGATE_Case) T, + casePROCESS func(HandlerType_PROCESS_Case) T, + caseINTEGRATION func(HandlerType_INTEGRATION_Case) T, + casePROJECTION func(HandlerType_PROJECTION_Case) T, +) T { + switch v { + case HandlerType_UNKNOWN_HANDLER_TYPE: + return caseUNKNOWN_HANDLER_TYPE(HandlerType_UNKNOWN_HANDLER_TYPE_Case{}) + case HandlerType_AGGREGATE: + return caseAGGREGATE(HandlerType_AGGREGATE_Case{}) + case HandlerType_PROCESS: + return casePROCESS(HandlerType_PROCESS_Case{}) + case HandlerType_INTEGRATION: + return caseINTEGRATION(HandlerType_INTEGRATION_Case{}) + case HandlerType_PROJECTION: + return casePROJECTION(HandlerType_PROJECTION_Case{}) + default: + panic(fmt.Sprintf("Map_HandlerType: %d is not a valid HandlerType", v)) + } +} + +// SetIdentity sets the x.Identity field to v, then returns x. +func (x *Application) SetIdentity(v *identitypb.Identity) { + x.Identity = v +} + +// SetGoType sets the x.GoType field to v, then returns x. +func (x *Application) SetGoType(v string) { + x.GoType = v +} + +// SetHandlers sets the x.Handlers field to v, then returns x. +func (x *Application) SetHandlers(v []*Handler) { + x.Handlers = v +} + +// SetIdentity sets the x.Identity field to v, then returns x. +func (x *Handler) SetIdentity(v *identitypb.Identity) { + x.Identity = v +} + +// SetGoType sets the x.GoType field to v, then returns x. +func (x *Handler) SetGoType(v string) { + x.GoType = v +} + +// SetType sets the x.Type field to v, then returns x. +func (x *Handler) SetType(v HandlerType) { + x.Type = v +} + +// SetProducedMessages sets the x.ProducedMessages field to v, then returns x. +func (x *Handler) SetProducedMessages(v map[string]MessageKind) { + x.ProducedMessages = v +} + +// SetConsumedMessages sets the x.ConsumedMessages field to v, then returns x. +func (x *Handler) SetConsumedMessages(v map[string]MessageKind) { + x.ConsumedMessages = v +} + +// SetIsDisabled sets the x.IsDisabled field to v, then returns x. +func (x *Handler) SetIsDisabled(v bool) { + x.IsDisabled = v +}