Documentation ¶
Index ¶
- Variables
- func NewEventSourcedConfiguredEntity(id eventsourced.EntityID) eventsourced.EntityHandler
- func NewTestModel(id eventsourced.EntityID) eventsourced.EntityHandler
- func NewTestModelTwo(id eventsourced.EntityID) eventsourced.EntityHandler
- func RegisterEventSourcedConfiguredServer(s grpc.ServiceRegistrar, srv EventSourcedConfiguredServer)
- func RegisterEventSourcedTckModelServer(s grpc.ServiceRegistrar, srv EventSourcedTckModelServer)
- func RegisterEventSourcedTwoServer(s grpc.ServiceRegistrar, srv EventSourcedTwoServer)
- type Effect
- type Emit
- type EventSourcedConfiguredClient
- type EventSourcedConfiguredEntity
- type EventSourcedConfiguredServer
- type EventSourcedTckModelClient
- type EventSourcedTckModelServer
- type EventSourcedTwoClient
- type EventSourcedTwoServer
- type Fail
- type Forward
- type Persisted
- type Request
- type RequestAction
- func (*RequestAction) Descriptor() ([]byte, []int)deprecated
- func (m *RequestAction) GetAction() isRequestAction_Action
- func (x *RequestAction) GetEffect() *Effect
- func (x *RequestAction) GetEmit() *Emit
- func (x *RequestAction) GetFail() *Fail
- func (x *RequestAction) GetForward() *Forward
- func (*RequestAction) ProtoMessage()
- func (x *RequestAction) ProtoReflect() protoreflect.Message
- func (x *RequestAction) Reset()
- func (x *RequestAction) String() string
- type RequestAction_Effect
- type RequestAction_Emit
- type RequestAction_Fail
- type RequestAction_Forward
- type Response
- type TestModel
- func (m *TestModel) HandleCommand(ctx *eventsourced.Context, name string, cmd proto.Message) (reply proto.Message, err error)
- func (m *TestModel) HandleEvent(ctx *eventsourced.Context, event interface{}) error
- func (m *TestModel) HandleSnapshot(ctx *eventsourced.Context, snapshot interface{}) error
- func (m *TestModel) Snapshot(ctx *eventsourced.Context) (snapshot interface{}, err error)
- type TestModelTwo
- type UnimplementedEventSourcedConfiguredServer
- type UnimplementedEventSourcedTckModelServer
- type UnimplementedEventSourcedTwoServer
- type UnsafeEventSourcedConfiguredServer
- type UnsafeEventSourcedTckModelServer
- type UnsafeEventSourcedTwoServer
Constants ¶
This section is empty.
Variables ¶
var File_eventsourced_proto protoreflect.FileDescriptor
Functions ¶
func NewEventSourcedConfiguredEntity ¶ added in v0.3.0
func NewEventSourcedConfiguredEntity(id eventsourced.EntityID) eventsourced.EntityHandler
func NewTestModel ¶
func NewTestModel(id eventsourced.EntityID) eventsourced.EntityHandler
func NewTestModelTwo ¶
func NewTestModelTwo(id eventsourced.EntityID) eventsourced.EntityHandler
func RegisterEventSourcedConfiguredServer ¶ added in v0.3.0
func RegisterEventSourcedConfiguredServer(s grpc.ServiceRegistrar, srv EventSourcedConfiguredServer)
func RegisterEventSourcedTckModelServer ¶
func RegisterEventSourcedTckModelServer(s grpc.ServiceRegistrar, srv EventSourcedTckModelServer)
func RegisterEventSourcedTwoServer ¶
func RegisterEventSourcedTwoServer(s grpc.ServiceRegistrar, srv EventSourcedTwoServer)
Types ¶
type Effect ¶
type Effect struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Synchronous bool `protobuf:"varint,2,opt,name=synchronous,proto3" json:"synchronous,omitempty"` // contains filtered or unexported fields }
Add a side effect to the reply, to `cloudstate.tck.model.EventSourcedTwo/Call`. The payload must be a `Request` message with the given `id`. The side effect should be marked synchronous based on the given `synchronous` value.
func (*Effect) Descriptor
deprecated
func (*Effect) GetSynchronous ¶
func (*Effect) ProtoMessage ¶
func (*Effect) ProtoMessage()
func (*Effect) ProtoReflect ¶
func (x *Effect) ProtoReflect() protoreflect.Message
type Emit ¶
type Emit struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Emit an event, with the event value in a `Persisted` message.
func (*Emit) Descriptor
deprecated
func (*Emit) ProtoMessage ¶
func (*Emit) ProtoMessage()
func (*Emit) ProtoReflect ¶
func (x *Emit) ProtoReflect() protoreflect.Message
type EventSourcedConfiguredClient ¶ added in v0.3.0
type EventSourcedConfiguredClient interface {
Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
EventSourcedConfiguredClient is the client API for EventSourcedConfigured 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 NewEventSourcedConfiguredClient ¶ added in v0.3.0
func NewEventSourcedConfiguredClient(cc grpc.ClientConnInterface) EventSourcedConfiguredClient
type EventSourcedConfiguredEntity ¶ added in v0.3.0
type EventSourcedConfiguredEntity struct { }
func (*EventSourcedConfiguredEntity) HandleCommand ¶ added in v0.3.0
func (e *EventSourcedConfiguredEntity) HandleCommand(ctx *eventsourced.Context, name string, cmd proto.Message) (reply proto.Message, err error)
func (*EventSourcedConfiguredEntity) HandleEvent ¶ added in v0.3.0
func (e *EventSourcedConfiguredEntity) HandleEvent(ctx *eventsourced.Context, event interface{}) error
type EventSourcedConfiguredServer ¶ added in v0.3.0
type EventSourcedConfiguredServer interface { Call(context.Context, *Request) (*Response, error) // contains filtered or unexported methods }
EventSourcedConfiguredServer is the server API for EventSourcedConfigured service. All implementations must embed UnimplementedEventSourcedConfiguredServer for forward compatibility
type EventSourcedTckModelClient ¶
type EventSourcedTckModelClient interface {
Process(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
EventSourcedTckModelClient is the client API for EventSourcedTckModel 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 NewEventSourcedTckModelClient ¶
func NewEventSourcedTckModelClient(cc grpc.ClientConnInterface) EventSourcedTckModelClient
type EventSourcedTckModelServer ¶
type EventSourcedTckModelServer interface { Process(context.Context, *Request) (*Response, error) // contains filtered or unexported methods }
EventSourcedTckModelServer is the server API for EventSourcedTckModel service. All implementations must embed UnimplementedEventSourcedTckModelServer for forward compatibility
type EventSourcedTwoClient ¶
type EventSourcedTwoClient interface {
Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
EventSourcedTwoClient is the client API for EventSourcedTwo 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 NewEventSourcedTwoClient ¶
func NewEventSourcedTwoClient(cc grpc.ClientConnInterface) EventSourcedTwoClient
type EventSourcedTwoServer ¶
type EventSourcedTwoServer interface { Call(context.Context, *Request) (*Response, error) // contains filtered or unexported methods }
EventSourcedTwoServer is the server API for EventSourcedTwo service. All implementations must embed UnimplementedEventSourcedTwoServer for forward compatibility
type Fail ¶
type Fail struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
Fail the current command with the given description `message`.
func (*Fail) Descriptor
deprecated
func (*Fail) GetMessage ¶
func (*Fail) ProtoMessage ¶
func (*Fail) ProtoMessage()
func (*Fail) ProtoReflect ¶
func (x *Fail) ProtoReflect() protoreflect.Message
type Forward ¶
type Forward struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
Replace the response with a forward to `cloudstate.tck.model.EventSourcedTwo/Call`. The payload must be a `Request` message with the given `id`.
func (*Forward) Descriptor
deprecated
func (*Forward) ProtoMessage ¶
func (*Forward) ProtoMessage()
func (*Forward) ProtoReflect ¶
func (x *Forward) ProtoReflect() protoreflect.Message
type Persisted ¶
type Persisted struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
The `Persisted` message wraps both snapshot and event values.
func (*Persisted) Descriptor
deprecated
func (*Persisted) ProtoMessage ¶
func (*Persisted) ProtoMessage()
func (*Persisted) ProtoReflect ¶
func (x *Persisted) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Actions []*RequestAction `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"` // contains filtered or unexported fields }
A `Request` message contains any actions that the entity should process. Actions must be processed in order. Any actions after a `Fail` may be ignored.
func (*Request) Descriptor
deprecated
func (*Request) GetActions ¶
func (x *Request) GetActions() []*RequestAction
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type RequestAction ¶
type RequestAction struct { // Types that are assignable to Action: // *RequestAction_Emit // *RequestAction_Forward // *RequestAction_Effect // *RequestAction_Fail Action isRequestAction_Action `protobuf_oneof:"action"` // contains filtered or unexported fields }
Each `RequestAction` is one of:
- Emit: emit an event, with a given value. - Forward: forward to another service, in place of replying with a Response. - Effect: add a side effect to another service to the reply. - Fail: fail the current `Process` command.
func (*RequestAction) Descriptor
deprecated
func (*RequestAction) Descriptor() ([]byte, []int)
Deprecated: Use RequestAction.ProtoReflect.Descriptor instead.
func (*RequestAction) GetAction ¶
func (m *RequestAction) GetAction() isRequestAction_Action
func (*RequestAction) GetEffect ¶
func (x *RequestAction) GetEffect() *Effect
func (*RequestAction) GetEmit ¶
func (x *RequestAction) GetEmit() *Emit
func (*RequestAction) GetFail ¶
func (x *RequestAction) GetFail() *Fail
func (*RequestAction) GetForward ¶
func (x *RequestAction) GetForward() *Forward
func (*RequestAction) ProtoMessage ¶
func (*RequestAction) ProtoMessage()
func (*RequestAction) ProtoReflect ¶
func (x *RequestAction) ProtoReflect() protoreflect.Message
func (*RequestAction) Reset ¶
func (x *RequestAction) Reset()
func (*RequestAction) String ¶
func (x *RequestAction) String() string
type RequestAction_Effect ¶
type RequestAction_Effect struct {
Effect *Effect `protobuf:"bytes,3,opt,name=effect,proto3,oneof"`
}
type RequestAction_Emit ¶
type RequestAction_Emit struct {
Emit *Emit `protobuf:"bytes,1,opt,name=emit,proto3,oneof"`
}
type RequestAction_Fail ¶
type RequestAction_Fail struct {
Fail *Fail `protobuf:"bytes,4,opt,name=fail,proto3,oneof"`
}
type RequestAction_Forward ¶
type RequestAction_Forward struct {
Forward *Forward `protobuf:"bytes,2,opt,name=forward,proto3,oneof"`
}
type Response ¶
type Response struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The `Response` message for the `Process` must contain the current state (after processing actions).
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type TestModel ¶
type TestModel struct {
// contains filtered or unexported fields
}
func (*TestModel) HandleCommand ¶
func (*TestModel) HandleEvent ¶
func (m *TestModel) HandleEvent(ctx *eventsourced.Context, event interface{}) error
func (*TestModel) HandleSnapshot ¶
func (m *TestModel) HandleSnapshot(ctx *eventsourced.Context, snapshot interface{}) error
type TestModelTwo ¶
type TestModelTwo struct { }
func (*TestModelTwo) HandleCommand ¶
func (m *TestModelTwo) HandleCommand(ctx *eventsourced.Context, name string, cmd proto.Message) (reply proto.Message, err error)
func (*TestModelTwo) HandleEvent ¶
func (m *TestModelTwo) HandleEvent(ctx *eventsourced.Context, event interface{}) error
type UnimplementedEventSourcedConfiguredServer ¶ added in v0.3.0
type UnimplementedEventSourcedConfiguredServer struct { }
UnimplementedEventSourcedConfiguredServer must be embedded to have forward compatible implementations.
type UnimplementedEventSourcedTckModelServer ¶
type UnimplementedEventSourcedTckModelServer struct { }
UnimplementedEventSourcedTckModelServer must be embedded to have forward compatible implementations.
type UnimplementedEventSourcedTwoServer ¶
type UnimplementedEventSourcedTwoServer struct { }
UnimplementedEventSourcedTwoServer must be embedded to have forward compatible implementations.
type UnsafeEventSourcedConfiguredServer ¶ added in v0.3.0
type UnsafeEventSourcedConfiguredServer interface {
// contains filtered or unexported methods
}
UnsafeEventSourcedConfiguredServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventSourcedConfiguredServer will result in compilation errors.
type UnsafeEventSourcedTckModelServer ¶ added in v0.3.0
type UnsafeEventSourcedTckModelServer interface {
// contains filtered or unexported methods
}
UnsafeEventSourcedTckModelServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventSourcedTckModelServer will result in compilation errors.
type UnsafeEventSourcedTwoServer ¶ added in v0.3.0
type UnsafeEventSourcedTwoServer interface {
// contains filtered or unexported methods
}
UnsafeEventSourcedTwoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventSourcedTwoServer will result in compilation errors.