Skip to content

Commit c2c3d20

Browse files
author
Sergio Andres Virviescas Santana
committed
Rename GracefulEnable to GracefulShutdown
1 parent 0a4a048 commit c2c3d20

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Is based on [erikdubbelboer's fasthttp fork](https://github.com/erikdubbelboer/f
2929
- TLSEnable *(bool)*: Enable HTTPS
3030
- CertKey *(string)*: Path of cert.key file
3131
- CertFile *(string)*: Path of cert.pem file
32-
- GracefulEnable *(bool)*: Start server with graceful shutdown
32+
- GracefulShutdown *(bool)*: Start server with graceful shutdown
3333

3434
## Note:
3535
`*atreugo.RequestCtx` is equal than `*fasthttp.RequestCtx`, but adding extra funtionality, so you can use

atreugo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (s *Atreugo) ListenAndServe() error {
152152
addr := fmt.Sprintf("%s:%d", s.cfg.Host, s.cfg.Port)
153153
ln := s.getListener(addr)
154154

155-
if s.cfg.GracefulEnable {
155+
if s.cfg.GracefulShutdown {
156156
return s.serveGracefully(ln)
157157
}
158158

atreugo_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@ func TestAtreugo_ListenAndServe(t *testing.T) {
540540
for _, tt := range tests {
541541
t.Run(tt.name, func(t *testing.T) {
542542
s := New(&Config{
543-
Host: "localhost",
544-
Port: 8000,
545-
LogLevel: "error",
546-
TLSEnable: tt.args.tlsEnable,
547-
GracefulEnable: tt.args.graceful,
543+
Host: "localhost",
544+
Port: 8000,
545+
LogLevel: "error",
546+
TLSEnable: tt.args.tlsEnable,
547+
GracefulShutdown: tt.args.graceful,
548548
})
549549

550550
serverCh := make(chan error, 1)

types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212

1313
// Config config for Atreugo
1414
type Config struct {
15-
Host string
16-
Port int
17-
LogLevel string
18-
Compress bool
19-
TLSEnable bool
20-
CertKey string
21-
CertFile string
22-
GracefulEnable bool
15+
Host string
16+
Port int
17+
LogLevel string
18+
Compress bool
19+
TLSEnable bool
20+
CertKey string
21+
CertFile string
22+
GracefulShutdown bool
2323
}
2424

2525
// Atreugo struct for make up a server

0 commit comments

Comments
 (0)