mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Added Chasm RPC handler foundation and interceptor. Added test as use case demo. ## Why? The Chasm RPC handler will be used as the abstraction layer for future work. A grpc interceptor was added to intercept requests to process boilerplate code so the handlers don't have to regurgitate it. Please look at the added test as it demonstrates how the RPC handler is registered and a request gets processed. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [ ] added new functional test(s) ## Potential risks There is a [future ticket](https://temporalio.atlassian.net/browse/ACT-69) to refactor all history RPC calls to start using the interceptor as to avoid boilerplate code. This does need a deeper discussion with the team and we also need to figure out how to identify the incoming RPC request so we can extract namespace etc. properly. --------- Co-authored-by: Roey Berman <[email protected]>
182 lines
6.7 KiB
Go
182 lines
6.7 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// plugins:
|
|
// protoc-gen-go
|
|
// protoc
|
|
// source: temporal/server/chasm/lib/tests/proto/v1/request_response.proto
|
|
|
|
package testspb
|
|
|
|
import (
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
)
|
|
|
|
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)
|
|
)
|
|
|
|
type TestRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *TestRequest) Reset() {
|
|
*x = TestRequest{}
|
|
mi := &file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *TestRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*TestRequest) ProtoMessage() {}
|
|
|
|
func (x *TestRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use TestRequest.ProtoReflect.Descriptor instead.
|
|
func (*TestRequest) Descriptor() ([]byte, []int) {
|
|
return file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *TestRequest) GetRequestId() string {
|
|
if x != nil {
|
|
return x.RequestId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type TestResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
|
|
HasEngineCtx bool `protobuf:"varint,2,opt,name=has_engine_ctx,json=hasEngineCtx,proto3" json:"has_engine_ctx,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *TestResponse) Reset() {
|
|
*x = TestResponse{}
|
|
mi := &file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *TestResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*TestResponse) ProtoMessage() {}
|
|
|
|
func (x *TestResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use TestResponse.ProtoReflect.Descriptor instead.
|
|
func (*TestResponse) Descriptor() ([]byte, []int) {
|
|
return file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *TestResponse) GetRequestId() string {
|
|
if x != nil {
|
|
return x.RequestId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *TestResponse) GetHasEngineCtx() bool {
|
|
if x != nil {
|
|
return x.HasEngineCtx
|
|
}
|
|
return false
|
|
}
|
|
|
|
var File_temporal_server_chasm_lib_tests_proto_v1_request_response_proto protoreflect.FileDescriptor
|
|
|
|
const file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDesc = "" +
|
|
"\n" +
|
|
"?temporal/server/chasm/lib/tests/proto/v1/request_response.proto\x12(temporal.server.chasm.lib.tests.proto.v1\",\n" +
|
|
"\vTestRequest\x12\x1d\n" +
|
|
"\n" +
|
|
"request_id\x18\x01 \x01(\tR\trequestId\"S\n" +
|
|
"\fTestResponse\x12\x1d\n" +
|
|
"\n" +
|
|
"request_id\x18\x01 \x01(\tR\trequestId\x12$\n" +
|
|
"\x0ehas_engine_ctx\x18\x02 \x01(\bR\fhasEngineCtxB;Z9go.temporal.io/server/chasm/lib/tests/gen/testspb;testspbb\x06proto3"
|
|
|
|
var (
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescOnce sync.Once
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescGZIP() []byte {
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescOnce.Do(func() {
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDesc), len(file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDesc)))
|
|
})
|
|
return file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDescData
|
|
}
|
|
|
|
var file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
var file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_goTypes = []any{
|
|
(*TestRequest)(nil), // 0: temporal.server.chasm.lib.tests.proto.v1.TestRequest
|
|
(*TestResponse)(nil), // 1: temporal.server.chasm.lib.tests.proto.v1.TestResponse
|
|
}
|
|
var file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_depIdxs = []int32{
|
|
0, // [0:0] is the sub-list for method output_type
|
|
0, // [0:0] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_init() }
|
|
func file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_init() {
|
|
if File_temporal_server_chasm_lib_tests_proto_v1_request_response_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDesc), len(file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 2,
|
|
NumExtensions: 0,
|
|
NumServices: 0,
|
|
},
|
|
GoTypes: file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_goTypes,
|
|
DependencyIndexes: file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_depIdxs,
|
|
MessageInfos: file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_msgTypes,
|
|
}.Build()
|
|
File_temporal_server_chasm_lib_tests_proto_v1_request_response_proto = out.File
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_goTypes = nil
|
|
file_temporal_server_chasm_lib_tests_proto_v1_request_response_proto_depIdxs = nil
|
|
}
|