eventsourced

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_eventsourced_proto protoreflect.FileDescriptor

Functions

func NewEventSourcedConfiguredEntity added in v0.3.0

func NewEventSourcedConfiguredEntity(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) Descriptor() ([]byte, []int)

Deprecated: Use Effect.ProtoReflect.Descriptor instead.

func (*Effect) GetId

func (x *Effect) GetId() string

func (*Effect) GetSynchronous

func (x *Effect) GetSynchronous() bool

func (*Effect) ProtoMessage

func (*Effect) ProtoMessage()

func (*Effect) ProtoReflect

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

func (*Effect) Reset

func (x *Effect) Reset()

func (*Effect) String

func (x *Effect) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Emit.ProtoReflect.Descriptor instead.

func (*Emit) GetValue

func (x *Emit) GetValue() string

func (*Emit) ProtoMessage

func (*Emit) ProtoMessage()

func (*Emit) ProtoReflect

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

func (*Emit) Reset

func (x *Emit) Reset()

func (*Emit) String

func (x *Emit) String() string

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.

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use Fail.ProtoReflect.Descriptor instead.

func (*Fail) GetMessage

func (x *Fail) GetMessage() string

func (*Fail) ProtoMessage

func (*Fail) ProtoMessage()

func (*Fail) ProtoReflect

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

func (*Fail) Reset

func (x *Fail) Reset()

func (*Fail) String

func (x *Fail) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Forward.ProtoReflect.Descriptor instead.

func (*Forward) GetId

func (x *Forward) GetId() string

func (*Forward) ProtoMessage

func (*Forward) ProtoMessage()

func (*Forward) ProtoReflect

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

func (*Forward) Reset

func (x *Forward) Reset()

func (*Forward) String

func (x *Forward) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Persisted.ProtoReflect.Descriptor instead.

func (*Persisted) GetValue

func (x *Persisted) GetValue() string

func (*Persisted) ProtoMessage

func (*Persisted) ProtoMessage()

func (*Persisted) ProtoReflect

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

func (*Persisted) Reset

func (x *Persisted) Reset()

func (*Persisted) String

func (x *Persisted) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetActions

func (x *Request) GetActions() []*RequestAction

func (*Request) GetId

func (x *Request) GetId() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type TestModel

type TestModel struct {
	// contains filtered or unexported fields
}

func (*TestModel) HandleCommand

func (m *TestModel) HandleCommand(ctx *eventsourced.Context, name string, cmd proto.Message) (reply proto.Message, err error)

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

func (*TestModel) Snapshot

func (m *TestModel) Snapshot(ctx *eventsourced.Context) (snapshot interface{}, err 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.

func (UnimplementedEventSourcedConfiguredServer) Call added in v0.3.0

type UnimplementedEventSourcedTckModelServer

type UnimplementedEventSourcedTckModelServer struct {
}

UnimplementedEventSourcedTckModelServer must be embedded to have forward compatible implementations.

func (UnimplementedEventSourcedTckModelServer) Process

type UnimplementedEventSourcedTwoServer

type UnimplementedEventSourcedTwoServer struct {
}

UnimplementedEventSourcedTwoServer must be embedded to have forward compatible implementations.

func (UnimplementedEventSourcedTwoServer) Call

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.

Jump to

Keyboard shortcuts

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