Skip to content
File

Blob: spec/mocks/tunnel_service.go

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