This commit is contained in:
parent
94b6ada40d
commit
f9038b02f6
BIN
README.gif
Normal file
BIN
README.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
11
README.md
11
README.md
@ -7,6 +7,8 @@ Package don is a little helper if you need to check for the readiness of somethi
|
||||
This could be a command to run (like ssh) or a `db.Ping()` for check of the readiness
|
||||
of a database container.
|
||||
|
||||
![readme](./README.gif)
|
||||
|
||||
## Use as commandline tool
|
||||
|
||||
Download the tool from the [download page](https://github.com/xsteadfastx/don/releases) or
|
||||
@ -52,8 +54,9 @@ if err := don.Ready(
|
||||
|
||||
return true
|
||||
},
|
||||
10*time.Minute,
|
||||
30*time.Second,
|
||||
10*time.Minute, // When to timeout completly.
|
||||
30*time.Second, // Whats the time between retries.
|
||||
false, // If you want a progressbar.
|
||||
); err != nil {
|
||||
log.Error().Err(err).Msg("received error")
|
||||
teardown(pool, resource, tmpState.Name())
|
||||
@ -63,14 +66,14 @@ if err := don.Ready(
|
||||
|
||||
## Functions
|
||||
|
||||
### func [Cmd](/don.go#L69)
|
||||
### func [Cmd](/don.go#L72)
|
||||
|
||||
`func Cmd(c string) func() bool`
|
||||
|
||||
Cmd returns a `func() bool` for working with `don.Ready()`. It executes a command and
|
||||
returns a true if everything looks fine or a false if there was some kind of error.
|
||||
|
||||
### func [Ready](/don.go#L87)
|
||||
### func [Ready](/don.go#L90)
|
||||
|
||||
`func Ready(f func() bool, timeout time.Duration, retry time.Duration, bar bool) error`
|
||||
|
||||
|
7
don.go
7
don.go
@ -2,6 +2,8 @@
|
||||
// This could be a command to run (like ssh) or a `db.Ping()` for check of the readiness
|
||||
// of a database container.
|
||||
//
|
||||
// (image/readme) ./README.gif
|
||||
//
|
||||
// Use as commandline tool
|
||||
//
|
||||
// Download the tool from the (download page) https://github.com/xsteadfastx/don/releases or
|
||||
@ -42,8 +44,9 @@
|
||||
//
|
||||
// return true
|
||||
// },
|
||||
// 10*time.Minute,
|
||||
// 30*time.Second,
|
||||
// 10*time.Minute, // When to timeout completly.
|
||||
// 30*time.Second, // Whats the time between retries.
|
||||
// false, // If you want a progressbar.
|
||||
// ); err != nil {
|
||||
// log.Error().Err(err).Msg("received error")
|
||||
// teardown(pool, resource, tmpState.Name())
|
||||
|
Loading…
Reference in New Issue
Block a user