* 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>
42 lines
1.5 KiB
Go
42 lines
1.5 KiB
Go
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")
|
|
}
|