-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathgo_http_server.go
More file actions
102 lines (78 loc) · 2.09 KB
/
go_http_server.go
File metadata and controls
102 lines (78 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Code generated by mockery v2.53.6. DO NOT EDIT.
package httpservermocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
net "net"
)
// GoHTTPServer is an autogenerated mock type for the GoHTTPServer type
type GoHTTPServer struct {
mock.Mock
}
// Close provides a mock function with no fields
func (_m *GoHTTPServer) Close() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Serve provides a mock function with given fields: l
func (_m *GoHTTPServer) Serve(l net.Listener) error {
ret := _m.Called(l)
if len(ret) == 0 {
panic("no return value specified for Serve")
}
var r0 error
if rf, ok := ret.Get(0).(func(net.Listener) error); ok {
r0 = rf(l)
} else {
r0 = ret.Error(0)
}
return r0
}
// ServeTLS provides a mock function with given fields: l, certFile, keyFile
func (_m *GoHTTPServer) ServeTLS(l net.Listener, certFile string, keyFile string) error {
ret := _m.Called(l, certFile, keyFile)
if len(ret) == 0 {
panic("no return value specified for ServeTLS")
}
var r0 error
if rf, ok := ret.Get(0).(func(net.Listener, string, string) error); ok {
r0 = rf(l, certFile, keyFile)
} else {
r0 = ret.Error(0)
}
return r0
}
// Shutdown provides a mock function with given fields: ctx
func (_m *GoHTTPServer) Shutdown(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Shutdown")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewGoHTTPServer creates a new instance of GoHTTPServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewGoHTTPServer(t interface {
mock.TestingT
Cleanup(func())
}) *GoHTTPServer {
mock := &GoHTTPServer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}