File
Blob: spec/mocks/tunnel_service.go
| 1 | //go:build !no_mocks |
| 2 | |
| 3 | package mocks |
| 4 | |
| 5 | import ( |
| 6 | "context" |
| 7 | |
| 8 | "go.miragespace.co/specter/spec/protocol" |
| 9 | |
| 10 | "github.com/stretchr/testify/mock" |
| 11 | ) |
| 12 | |
| 13 | type TunnelService struct { |
| 14 | mock.Mock |
| 15 | Keyless *KeylessService |
| 16 | } |
| 17 | |
| 18 | var _ protocol.TunnelService = (*TunnelService)(nil) |
| 19 | |
| 20 | func (t *TunnelService) OpenEphemeralSession(ctx context.Context, req *protocol.OpenEphemeralSessionRequest) (*protocol.OpenSessionResponse, error) { |
| 21 | args := t.Called(ctx, req) |
| 22 | if err := args.Error(1); err != nil { |
| 23 | return nil, err |
| 24 | } |
| 25 | return args.Get(0).(*protocol.OpenSessionResponse), nil |
| 26 | } |
| 27 | |
| 28 | func (t *TunnelService) OpenDelegatedSession(ctx context.Context, req *protocol.OpenDelegatedSessionRequest) (*protocol.OpenSessionResponse, error) { |
| 29 | args := t.Called(ctx, req) |
| 30 | if err := args.Error(1); err != nil { |
| 31 | return nil, err |
| 32 | } |
| 33 | return args.Get(0).(*protocol.OpenSessionResponse), nil |
| 34 | } |
| 35 | |
| 36 | func (t *TunnelService) Ping(ctx context.Context, req *protocol.ClientPingRequest) (*protocol.ClientPingResponse, error) { |
| 37 | args := t.Called(ctx, req) |
| 38 | r := args.Get(0) |
| 39 | e := args.Error(1) |
| 40 | if e != nil { |
| 41 | return nil, e |
| 42 | } |
| 43 | return r.(*protocol.ClientPingResponse), nil |
| 44 | } |
| 45 | |
| 46 | func (t *TunnelService) RegisterIdentity(ctx context.Context, req *protocol.RegisterIdentityRequest) (*protocol.RegisterIdentityResponse, error) { |
| 47 | args := t.Called(ctx, req) |
| 48 | r := args.Get(0) |
| 49 | e := args.Error(1) |
| 50 | if e != nil { |
| 51 | return nil, e |
| 52 | } |
| 53 | return r.(*protocol.RegisterIdentityResponse), nil |
| 54 | } |
| 55 | |
| 56 | func (t *TunnelService) GetNodes(ctx context.Context, req *protocol.GetNodesRequest) (*protocol.GetNodesResponse, error) { |
| 57 | args := t.Called(ctx, req) |
| 58 | r := args.Get(0) |
| 59 | e := args.Error(1) |
| 60 | if e != nil { |
| 61 | return nil, e |
| 62 | } |
| 63 | return r.(*protocol.GetNodesResponse), nil |
| 64 | } |
| 65 | |
| 66 | func (t *TunnelService) GenerateHostname(ctx context.Context, req *protocol.GenerateHostnameRequest) (*protocol.GenerateHostnameResponse, error) { |
| 67 | args := t.Called(ctx, req) |
| 68 | r := args.Get(0) |
| 69 | e := args.Error(1) |
| 70 | if e != nil { |
| 71 | return nil, e |
| 72 | } |
| 73 | return r.(*protocol.GenerateHostnameResponse), nil |
| 74 | } |
| 75 | |
| 76 | func (t *TunnelService) RegisteredHostnames(ctx context.Context, req *protocol.RegisteredHostnamesRequest) (*protocol.RegisteredHostnamesResponse, error) { |
| 77 | args := t.Called(ctx, req) |
| 78 | r := args.Get(0) |
| 79 | e := args.Error(1) |
| 80 | if e != nil { |
| 81 | return nil, e |
| 82 | } |
| 83 | return r.(*protocol.RegisteredHostnamesResponse), nil |
| 84 | } |
| 85 | |
| 86 | func (t *TunnelService) PublishTunnel(ctx context.Context, req *protocol.PublishTunnelRequest) (*protocol.PublishTunnelResponse, error) { |
| 87 | args := t.Called(ctx, req) |
| 88 | r := args.Get(0) |
| 89 | e := args.Error(1) |
| 90 | if e != nil { |
| 91 | return nil, e |
| 92 | } |
| 93 | return r.(*protocol.PublishTunnelResponse), nil |
| 94 | } |
| 95 | |
| 96 | func (t *TunnelService) UnpublishTunnel(ctx context.Context, req *protocol.UnpublishTunnelRequest) (*protocol.UnpublishTunnelResponse, error) { |
| 97 | args := t.Called(ctx, req) |
| 98 | r := args.Get(0) |
| 99 | e := args.Error(1) |
| 100 | if e != nil { |
| 101 | return nil, e |
| 102 | } |
| 103 | return r.(*protocol.UnpublishTunnelResponse), nil |
| 104 | } |
| 105 | |
| 106 | func (t *TunnelService) ReleaseTunnel(ctx context.Context, req *protocol.ReleaseTunnelRequest) (*protocol.ReleaseTunnelResponse, error) { |
| 107 | args := t.Called(ctx, req) |
| 108 | r := args.Get(0) |
| 109 | e := args.Error(1) |
| 110 | if e != nil { |
| 111 | return nil, e |
| 112 | } |
| 113 | return r.(*protocol.ReleaseTunnelResponse), nil |
| 114 | } |
| 115 | |
| 116 | func (t *TunnelService) AcmeInstruction(ctx context.Context, req *protocol.InstructionRequest) (*protocol.InstructionResponse, error) { |
| 117 | args := t.Called(ctx, req) |
| 118 | r := args.Get(0) |
| 119 | e := args.Error(1) |
| 120 | if e != nil { |
| 121 | return nil, e |
| 122 | } |
| 123 | return r.(*protocol.InstructionResponse), nil |
| 124 | } |
| 125 | |
| 126 | func (t *TunnelService) AcmeValidate(ctx context.Context, req *protocol.ValidateRequest) (*protocol.ValidateResponse, error) { |
| 127 | args := t.Called(ctx, req) |
| 128 | r := args.Get(0) |
| 129 | e := args.Error(1) |
| 130 | if e != nil { |
| 131 | return nil, e |
| 132 | } |
| 133 | return r.(*protocol.ValidateResponse), nil |
| 134 | } |
| 135 | |
| 136 | func (t *TunnelService) MintDelegation(ctx context.Context, req *protocol.MintDelegationRequest) (*protocol.MintDelegationResponse, error) { |
| 137 | args := t.Called(ctx, req) |
| 138 | if err := args.Error(1); err != nil { |
| 139 | return nil, err |
| 140 | } |
| 141 | return args.Get(0).(*protocol.MintDelegationResponse), nil |
| 142 | } |
| 143 | |
| 144 | func (t *TunnelService) ListDelegations(ctx context.Context, req *protocol.ListDelegationsRequest) (*protocol.ListDelegationsResponse, error) { |
| 145 | args := t.Called(ctx, req) |
| 146 | if err := args.Error(1); err != nil { |
| 147 | return nil, err |
| 148 | } |
| 149 | return args.Get(0).(*protocol.ListDelegationsResponse), nil |
| 150 | } |
| 151 | |
| 152 | func (t *TunnelService) RevokeDelegation(ctx context.Context, req *protocol.RevokeDelegationRequest) (*protocol.RevokeDelegationResponse, error) { |
| 153 | args := t.Called(ctx, req) |
| 154 | if err := args.Error(1); err != nil { |
| 155 | return nil, err |
| 156 | } |
| 157 | return args.Get(0).(*protocol.RevokeDelegationResponse), nil |
| 158 | } |