eventstore

package
v0.0.0-...-290c2ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "eventstore.EventStore",
	HandlerType: (*EventStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateEvent",
			Handler:    _EventStore_CreateEvent_Handler,
		},
		{
			MethodName: "GetEvents",
			Handler:    _EventStore_GetEvents_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetEventsStream",
			Handler:       _EventStore_GetEventsStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "eventstore/eventstore.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)

View Source
var File_eventstore_eventstore_proto protoreflect.FileDescriptor

Functions

func RegisterEventStoreServer

func RegisterEventStoreServer(s grpc.ServiceRegistrar, srv EventStoreServer)

Types

type CreateEventRequest

type CreateEventRequest struct {
	Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateEventRequest) Descriptor deprecated

func (*CreateEventRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateEventRequest.ProtoReflect.Descriptor instead.

func (*CreateEventRequest) GetEvent

func (x *CreateEventRequest) GetEvent() *Event

func (*CreateEventRequest) ProtoMessage

func (*CreateEventRequest) ProtoMessage()

func (*CreateEventRequest) ProtoReflect

func (x *CreateEventRequest) ProtoReflect() protoreflect.Message

func (*CreateEventRequest) Reset

func (x *CreateEventRequest) Reset()

func (*CreateEventRequest) String

func (x *CreateEventRequest) String() string

type CreateEventResponse

type CreateEventResponse struct {
	IsSuccess bool   `protobuf:"varint,1,opt,name=is_success,json=isSuccess,proto3" json:"is_success,omitempty"`
	Error     string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateEventResponse) Descriptor deprecated

func (*CreateEventResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateEventResponse.ProtoReflect.Descriptor instead.

func (*CreateEventResponse) GetError

func (x *CreateEventResponse) GetError() string

func (*CreateEventResponse) GetIsSuccess

func (x *CreateEventResponse) GetIsSuccess() bool

func (*CreateEventResponse) ProtoMessage

func (*CreateEventResponse) ProtoMessage()

func (*CreateEventResponse) ProtoReflect

func (x *CreateEventResponse) ProtoReflect() protoreflect.Message

func (*CreateEventResponse) Reset

func (x *CreateEventResponse) Reset()

func (*CreateEventResponse) String

func (x *CreateEventResponse) String() string

type Event

type Event struct {
	EventId       string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	EventType     string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	AggregateId   string `protobuf:"bytes,3,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"`
	AggregateType string `protobuf:"bytes,4,opt,name=aggregate_type,json=aggregateType,proto3" json:"aggregate_type,omitempty"`
	EventData     string `protobuf:"bytes,5,opt,name=event_data,json=eventData,proto3" json:"event_data,omitempty"`
	Stream        string `protobuf:"bytes,6,opt,name=stream,proto3" json:"stream,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetAggregateId

func (x *Event) GetAggregateId() string

func (*Event) GetAggregateType

func (x *Event) GetAggregateType() string

func (*Event) GetEventData

func (x *Event) GetEventData() string

func (*Event) GetEventId

func (x *Event) GetEventId() string

func (*Event) GetEventType

func (x *Event) GetEventType() string

func (*Event) GetStream

func (x *Event) GetStream() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventStoreClient

type EventStoreClient interface {
	// Create a new event to the event repository
	CreateEvent(ctx context.Context, in *CreateEventRequest, opts ...grpc.CallOption) (*CreateEventResponse, error)
	// Get all events for the given aggregate and event
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	// Get stream of events for the given event
	GetEventsStream(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (EventStore_GetEventsStreamClient, 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 {
	// Create a new event to the event repository
	CreateEvent(context.Context, *CreateEventRequest) (*CreateEventResponse, error)
	// Get all events for the given aggregate and event
	GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
	// Get stream of events for the given event
	GetEventsStream(*GetEventsRequest, EventStore_GetEventsStreamServer) error
	// contains filtered or unexported methods
}

EventStoreServer is the server API for EventStore service. All implementations must embed UnimplementedEventStoreServer for forward compatibility

type EventStore_GetEventsStreamClient

type EventStore_GetEventsStreamClient interface {
	Recv() (*Event, error)
	grpc.ClientStream
}

type EventStore_GetEventsStreamServer

type EventStore_GetEventsStreamServer interface {
	Send(*Event) error
	grpc.ServerStream
}

type GetEventsRequest

type GetEventsRequest struct {
	EventId     string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	AggregateId string `protobuf:"bytes,2,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsRequest) Descriptor deprecated

func (*GetEventsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEventsRequest.ProtoReflect.Descriptor instead.

func (*GetEventsRequest) GetAggregateId

func (x *GetEventsRequest) GetAggregateId() string

func (*GetEventsRequest) GetEventId

func (x *GetEventsRequest) GetEventId() string

func (*GetEventsRequest) ProtoMessage

func (*GetEventsRequest) ProtoMessage()

func (*GetEventsRequest) ProtoReflect

func (x *GetEventsRequest) ProtoReflect() protoreflect.Message

func (*GetEventsRequest) Reset

func (x *GetEventsRequest) Reset()

func (*GetEventsRequest) String

func (x *GetEventsRequest) String() string

type GetEventsResponse

type GetEventsResponse struct {
	Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsResponse) Descriptor deprecated

func (*GetEventsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEventsResponse.ProtoReflect.Descriptor instead.

func (*GetEventsResponse) GetEvents

func (x *GetEventsResponse) GetEvents() []*Event

func (*GetEventsResponse) ProtoMessage

func (*GetEventsResponse) ProtoMessage()

func (*GetEventsResponse) ProtoReflect

func (x *GetEventsResponse) ProtoReflect() protoreflect.Message

func (*GetEventsResponse) Reset

func (x *GetEventsResponse) Reset()

func (*GetEventsResponse) String

func (x *GetEventsResponse) String() string

type Repository

type Repository interface {
	CreateEvent(ctx context.Context, event *Event) error
	GetEvents(ctx context.Context, filter *GetEventsRequest) ([]*Event, error)
}

type UnimplementedEventStoreServer

type UnimplementedEventStoreServer struct {
}

UnimplementedEventStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedEventStoreServer) CreateEvent

func (UnimplementedEventStoreServer) GetEvents

func (UnimplementedEventStoreServer) GetEventsStream

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL