refactor(worker): Move tcp_proxy into its own package (#1458)
* refactor(worker): Move tcp_proxy into its own package This refactors: - the tcp_proxy.go into worker/proxy/tcp - add a missing unit test for the HandleTcpProxyV1 - refactors session.go into worker/session, needed to avoid import cycle - adds a baseline for a mock controller session client - go lint fixes * Add sleep between spinning listener goroutine and dialing Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
This commit is contained in:
1 parent
c79daab68c
commit
31af49e76d
29 files changed
+1229
-773
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// TODO (lcr 08/2021): implement mockSessionServiceClient outside of primitive support for
|
||||
// ConnectConnection
|
||||
type mockSessionServiceClient struct{}
|
||||
|
||||
func NewMockSessionServiceClient() SessionServiceClient {
|
||||
return &mockSessionServiceClient{}
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) LookupSession(_ context.Context, _ *LookupSessionRequest, _ ...grpc.CallOption) (*LookupSessionResponse, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) ActivateSession(_ context.Context, _ *ActivateSessionRequest, _ ...grpc.CallOption) (*ActivateSessionResponse, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) CancelSession(_ context.Context, _ *CancelSessionRequest, _ ...grpc.CallOption) (*CancelSessionResponse, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) AuthorizeConnection(_ context.Context, _ *AuthorizeConnectionRequest, _ ...grpc.CallOption) (*AuthorizeConnectionResponse, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) ConnectConnection(_ context.Context, _ *ConnectConnectionRequest, _ ...grpc.CallOption) (*ConnectConnectionResponse, error) {
|
||||
return &ConnectConnectionResponse{
|
||||
Status: CONNECTIONSTATUS_CONNECTIONSTATUS_CONNECTED,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *mockSessionServiceClient) CloseConnection(_ context.Context, _ *CloseConnectionRequest, _ ...grpc.CallOption) (*CloseConnectionResponse, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
Reference in new issue
Block a user