Skip to content

Commit

Permalink
Rename GracefulEnable to GracefulShutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Andres Virviescas Santana committed Aug 20, 2018
1 parent 0a4a048 commit c2c3d20
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Is based on [erikdubbelboer's fasthttp fork](https://github.com/erikdubbelboer/f
- TLSEnable *(bool)*: Enable HTTPS
- CertKey *(string)*: Path of cert.key file
- CertFile *(string)*: Path of cert.pem file
- GracefulEnable *(bool)*: Start server with graceful shutdown
- GracefulShutdown *(bool)*: Start server with graceful shutdown

## Note:
`*atreugo.RequestCtx` is equal than `*fasthttp.RequestCtx`, but adding extra funtionality, so you can use
Expand Down
2 changes: 1 addition & 1 deletion atreugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (s *Atreugo) ListenAndServe() error {
addr := fmt.Sprintf("%s:%d", s.cfg.Host, s.cfg.Port)
ln := s.getListener(addr)

if s.cfg.GracefulEnable {
if s.cfg.GracefulShutdown {
return s.serveGracefully(ln)
}

Expand Down
10 changes: 5 additions & 5 deletions atreugo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ func TestAtreugo_ListenAndServe(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := New(&Config{
Host: "localhost",
Port: 8000,
LogLevel: "error",
TLSEnable: tt.args.tlsEnable,
GracefulEnable: tt.args.graceful,
Host: "localhost",
Port: 8000,
LogLevel: "error",
TLSEnable: tt.args.tlsEnable,
GracefulShutdown: tt.args.graceful,
})

serverCh := make(chan error, 1)
Expand Down
16 changes: 8 additions & 8 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (

// Config config for Atreugo
type Config struct {
Host string
Port int
LogLevel string
Compress bool
TLSEnable bool
CertKey string
CertFile string
GracefulEnable bool
Host string
Port int
LogLevel string
Compress bool
TLSEnable bool
CertKey string
CertFile string
GracefulShutdown bool
}

// Atreugo struct for make up a server
Expand Down

0 comments on commit c2c3d20

Please sign in to comment.