File tree Expand file tree Collapse file tree 4 files changed +16
-16
lines changed Expand file tree Collapse file tree 4 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,8 @@ type (
199
199
Config struct {
200
200
Address string // TCP address to listen on.
201
201
Listener net.Listener // Custom `net.Listener`. If set, server accepts connections on it.
202
- TLSCertfile string // TLS certificate file path.
203
- TLSKeyfile string // TLS key file path.
202
+ TLSCertFile string // TLS certificate file path.
203
+ TLSKeyFile string // TLS key file path.
204
204
ReadTimeout time.Duration // Maximum duration before timing out read of the request.
205
205
WriteTimeout time.Duration // Maximum duration before timing out write of the response.
206
206
}
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ func New(addr string) *Server {
41
41
func WithTLS (addr , certFile , keyFile string ) * Server {
42
42
c := engine.Config {
43
43
Address : addr ,
44
- TLSCertfile : certFile ,
45
- TLSKeyfile : keyFile ,
44
+ TLSCertFile : certFile ,
45
+ TLSKeyFile : keyFile ,
46
46
}
47
47
return WithConfig (c )
48
48
}
@@ -111,16 +111,16 @@ func (s *Server) Start() error {
111
111
112
112
func (s * Server ) startDefaultListener () error {
113
113
c := s .config
114
- if c .TLSCertfile != "" && c .TLSKeyfile != "" {
115
- return s .ListenAndServeTLS (c .Address , c .TLSCertfile , c .TLSKeyfile )
114
+ if c .TLSCertFile != "" && c .TLSKeyFile != "" {
115
+ return s .ListenAndServeTLS (c .Address , c .TLSCertFile , c .TLSKeyFile )
116
116
}
117
117
return s .ListenAndServe (c .Address )
118
118
}
119
119
120
120
func (s * Server ) startCustomListener () error {
121
121
c := s .config
122
- if c .TLSCertfile != "" && c .TLSKeyfile != "" {
123
- return s .ServeTLS (c .Listener , c .TLSCertfile , c .TLSKeyfile )
122
+ if c .TLSCertFile != "" && c .TLSKeyFile != "" {
123
+ return s .ServeTLS (c .Listener , c .TLSCertFile , c .TLSKeyFile )
124
124
}
125
125
return s .Serve (c .Listener )
126
126
}
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ func New(addr string) *Server {
39
39
func WithTLS (addr , certFile , keyFile string ) * Server {
40
40
c := engine.Config {
41
41
Address : addr ,
42
- TLSCertfile : certFile ,
43
- TLSKeyfile : keyFile ,
42
+ TLSCertFile : certFile ,
43
+ TLSKeyFile : keyFile ,
44
44
}
45
45
return WithConfig (c )
46
46
}
@@ -109,8 +109,8 @@ func (s *Server) Start() error {
109
109
110
110
func (s * Server ) startDefaultListener () error {
111
111
c := s .config
112
- if c .TLSCertfile != "" && c .TLSKeyfile != "" {
113
- return s .ListenAndServeTLS (c .TLSCertfile , c .TLSKeyfile )
112
+ if c .TLSCertFile != "" && c .TLSKeyFile != "" {
113
+ return s .ListenAndServeTLS (c .TLSCertFile , c .TLSKeyFile )
114
114
}
115
115
return s .ListenAndServe ()
116
116
}
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ func New(addr string) *Server {
33
33
func NewTLS (addr , certFile , keyFile string ) * Server {
34
34
c := & engine.Config {
35
35
Address : addr ,
36
- TLSCertfile : certFile ,
37
- TLSKeyfile : keyFile ,
36
+ TLSCertFile : certFile ,
37
+ TLSKeyFile : keyFile ,
38
38
}
39
39
return NewConfig (c )
40
40
}
@@ -84,8 +84,8 @@ func (s *Server) SetLogger(l *log.Logger) {
84
84
func (s * Server ) Start () {
85
85
s .Addr = s .config .Address
86
86
s .Handler = s
87
- certFile := s .config .TLSCertfile
88
- keyFile := s .config .TLSKeyfile
87
+ certFile := s .config .TLSCertFile
88
+ keyFile := s .config .TLSKeyFile
89
89
if certFile != "" && keyFile != "" {
90
90
s .logger .Fatal (s .ListenAndServeTLS (certFile , keyFile ))
91
91
} else {
You can’t perform that action at this time.
0 commit comments