support_test.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package pogs
  2. import (
  3. "context"
  4. "github.com/google/uuid"
  5. )
  6. // mockTunnelServerBase provides a placeholder implementation
  7. // for TunnelServer interface that can be used to build
  8. // mocks for specific unit tests without having to implement every method
  9. type mockTunnelServerBase struct{}
  10. func (mockTunnelServerBase) RegisterConnection(ctx context.Context, auth TunnelAuth, tunnelID uuid.UUID, connIndex byte, options *ConnectionOptions) (*ConnectionDetails, error) {
  11. panic("unexpected call to RegisterConnection")
  12. }
  13. func (mockTunnelServerBase) UnregisterConnection(ctx context.Context) {
  14. panic("unexpected call to UnregisterConnection")
  15. }
  16. func (mockTunnelServerBase) RegisterTunnel(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) *TunnelRegistration {
  17. panic("unexpected call to RegisterTunnel")
  18. }
  19. func (mockTunnelServerBase) GetServerInfo(ctx context.Context) (*ServerInfo, error) {
  20. panic("unexpected call to GetServerInfo")
  21. }
  22. func (mockTunnelServerBase) UnregisterTunnel(ctx context.Context, gracePeriodNanoSec int64) error {
  23. panic("unexpected call to UnregisterTunnel")
  24. }
  25. func (mockTunnelServerBase) Authenticate(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) (*AuthenticateResponse, error) {
  26. panic("unexpected call to Authenticate")
  27. }
  28. func (mockTunnelServerBase) ReconnectTunnel(ctx context.Context, jwt, eventDigest, connDigest []byte, hostname string, options *RegistrationOptions) (*TunnelRegistration, error) {
  29. panic("unexpected call to ReconnectTunnel")
  30. }