Skip to content

Commit 712a27c

Browse files
committed
add extra blank spaces in README.md
1 parent 0b19bf3 commit 712a27c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ and global termination timeout for the whole application.
3232
# ⚙️ Usage
3333

3434
Get the library:
35+
3536
```bash
3637
go get -u github.com/skovtunenko/graterm
3738
```
3839

3940
Import the library into the project:
41+
4042
```go
4143
import (
4244
"github.com/skovtunenko/graterm"
@@ -45,13 +47,15 @@ import (
4547

4648
Create a new instance of [Terminator](https://pkg.go.dev/github.com/skovtunenko/graterm#Terminator) and get an application context
4749
that will be cancelled when one of the registered `os.Signal`s will occur:
50+
4851
```go
4952
// create new Terminator instance:
5053
terminator, appCtx := graterm.NewWithSignals(context.Background(), syscall.SIGINT, syscall.SIGTERM)
5154
terminator.SetLogger(log.Default()) // Optionally set the custom logger implementation instead of default NOOP one
5255
```
5356

5457
Optionally define [Order](https://pkg.go.dev/github.com/skovtunenko/graterm#Order) of components to be terminated at the end:
58+
5559
```go
5660
const (
5761
HTTPServerTerminationOrder graterm.Order = 1
@@ -62,6 +66,7 @@ const (
6266
```
6367

6468
Register some termination [Hooks](https://pkg.go.dev/github.com/skovtunenko/graterm#Hook) with priorities:
69+
6570
```go
6671
terminator.WithOrder(HTTPServerTerminationOrder).
6772
WithName("HTTP Server"). // setting a Name is optional and will be useful only if logger instance provided
@@ -73,6 +78,7 @@ terminator.WithOrder(HTTPServerTerminationOrder).
7378
```
7479

7580
Block main goroutine until the application receives one of the registered `os.Signal`s:
81+
7682
```go
7783
if err := terminator.Wait(appCtx, 20*time.Second); err != nil {
7884
log.Printf("graceful termination period was timed out: %+v", err)
@@ -213,18 +219,22 @@ The full-fledged example located here: [example.go](https://github.com/skovtunen
213219

214220
📖 Testing
215221
-----------
222+
216223
Unit-tests with code coverage:
224+
217225
```bash
218226
make test
219227
```
220228

221229
Run linter:
230+
222231
```bash
223232
make code-quality
224233
```
225234

226235
⚠️ LICENSE
227236
-----------
237+
228238
[MIT](https://github.com/skovtunenko/graterm/blob/main/LICENSE)
229239

230240
🕶️ AUTHORS

0 commit comments

Comments
 (0)