Documentation ¶
Index ¶
- Variables
- func RegisterCommandHandlerServer(s grpc.ServiceRegistrar, srv CommandHandlerServer)
- func RegisterEventStoreServer(s grpc.ServiceRegistrar, srv EventStoreServer)
- type CommandHandlerClient
- type CommandHandlerServer
- type CommandReply
- func (*CommandReply) Descriptor() ([]byte, []int)deprecated
- func (x *CommandReply) GetAggregateId() string
- func (x *CommandReply) GetVersion() uint64
- func (*CommandReply) ProtoMessage()
- func (x *CommandReply) ProtoReflect() protoreflect.Message
- func (x *CommandReply) Reset()
- func (x *CommandReply) String() string
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetAggregateId() string
- func (x *Event) GetAggregateType() string
- func (x *Event) GetAggregateVersion() *wrapperspb.UInt64Value
- func (x *Event) GetData() []byte
- func (x *Event) GetMetadata() map[string]string
- func (x *Event) GetTimestamp() *timestamppb.Timestamp
- func (x *Event) GetType() string
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventFilter
- func (*EventFilter) Descriptor() ([]byte, []int)deprecated
- func (x *EventFilter) GetAggregateId() *wrapperspb.StringValue
- func (x *EventFilter) GetAggregateType() *wrapperspb.StringValue
- func (x *EventFilter) GetMaxTimestamp() *timestamppb.Timestamp
- func (x *EventFilter) GetMaxVersion() *wrapperspb.UInt64Value
- func (x *EventFilter) GetMinTimestamp() *timestamppb.Timestamp
- func (x *EventFilter) GetMinVersion() *wrapperspb.UInt64Value
- func (*EventFilter) ProtoMessage()
- func (x *EventFilter) ProtoReflect() protoreflect.Message
- func (x *EventFilter) Reset()
- func (x *EventFilter) String() string
- type EventStoreClient
- type EventStoreServer
- type EventStore_RetrieveClient
- type EventStore_RetrieveServer
- type EventStore_StoreClient
- type EventStore_StoreServer
- type UnimplementedCommandHandlerServer
- type UnimplementedEventStoreServer
- type UnsafeCommandHandlerServer
- type UnsafeEventStoreServer
Constants ¶
This section is empty.
Variables ¶
var CommandHandler_ServiceDesc = grpc.ServiceDesc{ ServiceName: "eventsourcing.CommandHandler", HandlerType: (*CommandHandlerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Execute", Handler: _CommandHandler_Execute_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/eventsourcing/commandhandler_service.proto", }
CommandHandler_ServiceDesc is the grpc.ServiceDesc for CommandHandler service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var EventStore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "eventsourcing.EventStore", HandlerType: (*EventStoreServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Store", Handler: _EventStore_Store_Handler, ClientStreams: true, }, { StreamName: "Retrieve", Handler: _EventStore_Retrieve_Handler, ServerStreams: true, }, }, Metadata: "api/eventsourcing/eventstore_service.proto", }
EventStore_ServiceDesc is the grpc.ServiceDesc for EventStore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_eventsourcing_commandhandler_service_proto protoreflect.FileDescriptor
var File_api_eventsourcing_eventstore_service_proto protoreflect.FileDescriptor
var File_api_eventsourcing_messages_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCommandHandlerServer ¶
func RegisterCommandHandlerServer(s grpc.ServiceRegistrar, srv CommandHandlerServer)
func RegisterEventStoreServer ¶
func RegisterEventStoreServer(s grpc.ServiceRegistrar, srv EventStoreServer)
Types ¶
type CommandHandlerClient ¶
type CommandHandlerClient interface { // Execute executes a command. Execute(ctx context.Context, in *commands.Command, opts ...grpc.CallOption) (*CommandReply, error) }
CommandHandlerClient is the client API for CommandHandler service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewCommandHandlerClient ¶
func NewCommandHandlerClient(cc grpc.ClientConnInterface) CommandHandlerClient
type CommandHandlerServer ¶
type CommandHandlerServer interface { // Execute executes a command. Execute(context.Context, *commands.Command) (*CommandReply, error) // contains filtered or unexported methods }
CommandHandlerServer is the server API for CommandHandler service. All implementations must embed UnimplementedCommandHandlerServer for forward compatibility
type CommandReply ¶
type CommandReply struct { // UUID of the referenced aggregate. If this was a "Create*" command, the ID // provied with the command is ignored. A valid ID is generated by the command // handler and returned here. AggregateId string `protobuf:"bytes,1,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` // required // Version of the aggregate after command being executed. Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func (*CommandReply) Descriptor
deprecated
func (*CommandReply) Descriptor() ([]byte, []int)
Deprecated: Use CommandReply.ProtoReflect.Descriptor instead.
func (*CommandReply) GetAggregateId ¶
func (x *CommandReply) GetAggregateId() string
func (*CommandReply) GetVersion ¶
func (x *CommandReply) GetVersion() uint64
func (*CommandReply) ProtoMessage ¶
func (*CommandReply) ProtoMessage()
func (*CommandReply) ProtoReflect ¶
func (x *CommandReply) ProtoReflect() protoreflect.Message
func (*CommandReply) Reset ¶
func (x *CommandReply) Reset()
func (*CommandReply) String ¶
func (x *CommandReply) String() string
type Event ¶
type Event struct { // Type of the event Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Timestamp of when the event was created Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // ID of the aggregate that the event should be applied to (UUID 128-bit // number) AggregateId string `protobuf:"bytes,3,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` // Type of the aggregate that the event can be applied to AggregateType string `protobuf:"bytes,4,opt,name=aggregate_type,json=aggregateType,proto3" json:"aggregate_type,omitempty"` // Strict monotone counter, per aggregate/aggregate_id relation AggregateVersion *wrapperspb.UInt64Value `protobuf:"bytes,5,opt,name=aggregate_version,json=aggregateVersion,proto3" json:"aggregate_version,omitempty"` // Event type specific event data Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` // Event meta data Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Event describes anything that has happened in the system. An event type name should be in past tense and contain the intent (TenantUpdated). The event should contain all the data needed when applying/handling it. The combination of aggregate_type, aggregate_id and version is unique.
func (*Event) Descriptor
deprecated
func (*Event) GetAggregateId ¶
func (*Event) GetAggregateType ¶
func (*Event) GetAggregateVersion ¶
func (x *Event) GetAggregateVersion() *wrapperspb.UInt64Value
func (*Event) GetMetadata ¶
func (*Event) GetTimestamp ¶
func (x *Event) GetTimestamp() *timestamppb.Timestamp
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventFilter ¶
type EventFilter struct { // Filter events by aggregate_id AggregateId *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` // Filter events for a specific aggregate type AggregateType *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=aggregate_type,json=aggregateType,proto3" json:"aggregate_type,omitempty"` // Filter events with a version >= min_version MinVersion *wrapperspb.UInt64Value `protobuf:"bytes,3,opt,name=min_version,json=minVersion,proto3" json:"min_version,omitempty"` // Filter events with a version <= max_version MaxVersion *wrapperspb.UInt64Value `protobuf:"bytes,4,opt,name=max_version,json=maxVersion,proto3" json:"max_version,omitempty"` // Filter events with a timestamp >= min_timestamp MinTimestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=min_timestamp,json=minTimestamp,proto3" json:"min_timestamp,omitempty"` // Filter events with a timestamp <= max_timestamp MaxTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=max_timestamp,json=maxTimestamp,proto3" json:"max_timestamp,omitempty"` // contains filtered or unexported fields }
Request to get Events from to the store
func (*EventFilter) Descriptor
deprecated
func (*EventFilter) Descriptor() ([]byte, []int)
Deprecated: Use EventFilter.ProtoReflect.Descriptor instead.
func (*EventFilter) GetAggregateId ¶
func (x *EventFilter) GetAggregateId() *wrapperspb.StringValue
func (*EventFilter) GetAggregateType ¶
func (x *EventFilter) GetAggregateType() *wrapperspb.StringValue
func (*EventFilter) GetMaxTimestamp ¶
func (x *EventFilter) GetMaxTimestamp() *timestamppb.Timestamp
func (*EventFilter) GetMaxVersion ¶
func (x *EventFilter) GetMaxVersion() *wrapperspb.UInt64Value
func (*EventFilter) GetMinTimestamp ¶
func (x *EventFilter) GetMinTimestamp() *timestamppb.Timestamp
func (*EventFilter) GetMinVersion ¶
func (x *EventFilter) GetMinVersion() *wrapperspb.UInt64Value
func (*EventFilter) ProtoMessage ¶
func (*EventFilter) ProtoMessage()
func (*EventFilter) ProtoReflect ¶
func (x *EventFilter) ProtoReflect() protoreflect.Message
func (*EventFilter) Reset ¶
func (x *EventFilter) Reset()
func (*EventFilter) String ¶
func (x *EventFilter) String() string
type EventStoreClient ¶
type EventStoreClient interface { // Stream events to the store. Store(ctx context.Context, opts ...grpc.CallOption) (EventStore_StoreClient, error) // Get a stream of Events Retrieve(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (EventStore_RetrieveClient, error) }
EventStoreClient is the client API for EventStore service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEventStoreClient ¶
func NewEventStoreClient(cc grpc.ClientConnInterface) EventStoreClient
type EventStoreServer ¶
type EventStoreServer interface { // Stream events to the store. Store(EventStore_StoreServer) error // Get a stream of Events Retrieve(*EventFilter, EventStore_RetrieveServer) error // contains filtered or unexported methods }
EventStoreServer is the server API for EventStore service. All implementations must embed UnimplementedEventStoreServer for forward compatibility
type EventStore_RetrieveClient ¶
type EventStore_RetrieveClient interface { Recv() (*Event, error) grpc.ClientStream }
type EventStore_RetrieveServer ¶
type EventStore_RetrieveServer interface { Send(*Event) error grpc.ServerStream }
type EventStore_StoreClient ¶
type EventStore_StoreServer ¶
type UnimplementedCommandHandlerServer ¶
type UnimplementedCommandHandlerServer struct { }
UnimplementedCommandHandlerServer must be embedded to have forward compatible implementations.
func (UnimplementedCommandHandlerServer) Execute ¶
func (UnimplementedCommandHandlerServer) Execute(context.Context, *commands.Command) (*CommandReply, error)
type UnimplementedEventStoreServer ¶
type UnimplementedEventStoreServer struct { }
UnimplementedEventStoreServer must be embedded to have forward compatible implementations.
func (UnimplementedEventStoreServer) Retrieve ¶
func (UnimplementedEventStoreServer) Retrieve(*EventFilter, EventStore_RetrieveServer) error
func (UnimplementedEventStoreServer) Store ¶
func (UnimplementedEventStoreServer) Store(EventStore_StoreServer) error
type UnsafeCommandHandlerServer ¶
type UnsafeCommandHandlerServer interface {
// contains filtered or unexported methods
}
UnsafeCommandHandlerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CommandHandlerServer will result in compilation errors.
type UnsafeEventStoreServer ¶
type UnsafeEventStoreServer interface {
// contains filtered or unexported methods
}
UnsafeEventStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventStoreServer will result in compilation errors.