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]>
146 lines
4.2 KiB
Go
146 lines
4.2 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: library.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package chasm -source library.go -destination library_mock.go
|
|
//
|
|
|
|
// Package chasm is a generated GoMock package.
|
|
package chasm
|
|
|
|
import (
|
|
reflect "reflect"
|
|
|
|
gomock "go.uber.org/mock/gomock"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// MockLibrary is a mock of Library interface.
|
|
type MockLibrary struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockLibraryMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockLibraryMockRecorder is the mock recorder for MockLibrary.
|
|
type MockLibraryMockRecorder struct {
|
|
mock *MockLibrary
|
|
}
|
|
|
|
// NewMockLibrary creates a new mock instance.
|
|
func NewMockLibrary(ctrl *gomock.Controller) *MockLibrary {
|
|
mock := &MockLibrary{ctrl: ctrl}
|
|
mock.recorder = &MockLibraryMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockLibrary) EXPECT() *MockLibraryMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Components mocks base method.
|
|
func (m *MockLibrary) Components() []*RegistrableComponent {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Components")
|
|
ret0, _ := ret[0].([]*RegistrableComponent)
|
|
return ret0
|
|
}
|
|
|
|
// Components indicates an expected call of Components.
|
|
func (mr *MockLibraryMockRecorder) Components() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Components", reflect.TypeOf((*MockLibrary)(nil).Components))
|
|
}
|
|
|
|
// Name mocks base method.
|
|
func (m *MockLibrary) Name() string {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Name")
|
|
ret0, _ := ret[0].(string)
|
|
return ret0
|
|
}
|
|
|
|
// Name indicates an expected call of Name.
|
|
func (mr *MockLibraryMockRecorder) Name() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockLibrary)(nil).Name))
|
|
}
|
|
|
|
// RegisterServices mocks base method.
|
|
func (m *MockLibrary) RegisterServices(server *grpc.Server) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "RegisterServices", server)
|
|
}
|
|
|
|
// RegisterServices indicates an expected call of RegisterServices.
|
|
func (mr *MockLibraryMockRecorder) RegisterServices(server any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockLibrary)(nil).RegisterServices), server)
|
|
}
|
|
|
|
// Tasks mocks base method.
|
|
func (m *MockLibrary) Tasks() []*RegistrableTask {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Tasks")
|
|
ret0, _ := ret[0].([]*RegistrableTask)
|
|
return ret0
|
|
}
|
|
|
|
// Tasks indicates an expected call of Tasks.
|
|
func (mr *MockLibraryMockRecorder) Tasks() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tasks", reflect.TypeOf((*MockLibrary)(nil).Tasks))
|
|
}
|
|
|
|
// mustEmbedUnimplementedLibrary mocks base method.
|
|
func (m *MockLibrary) mustEmbedUnimplementedLibrary() {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "mustEmbedUnimplementedLibrary")
|
|
}
|
|
|
|
// mustEmbedUnimplementedLibrary indicates an expected call of mustEmbedUnimplementedLibrary.
|
|
func (mr *MockLibraryMockRecorder) mustEmbedUnimplementedLibrary() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "mustEmbedUnimplementedLibrary", reflect.TypeOf((*MockLibrary)(nil).mustEmbedUnimplementedLibrary))
|
|
}
|
|
|
|
// Mocknamer is a mock of namer interface.
|
|
type Mocknamer struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MocknamerMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MocknamerMockRecorder is the mock recorder for Mocknamer.
|
|
type MocknamerMockRecorder struct {
|
|
mock *Mocknamer
|
|
}
|
|
|
|
// NewMocknamer creates a new mock instance.
|
|
func NewMocknamer(ctrl *gomock.Controller) *Mocknamer {
|
|
mock := &Mocknamer{ctrl: ctrl}
|
|
mock.recorder = &MocknamerMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *Mocknamer) EXPECT() *MocknamerMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Name mocks base method.
|
|
func (m *Mocknamer) Name() string {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Name")
|
|
ret0, _ := ret[0].(string)
|
|
return ret0
|
|
}
|
|
|
|
// Name indicates an expected call of Name.
|
|
func (mr *MocknamerMockRecorder) Name() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*Mocknamer)(nil).Name))
|
|
}
|