docs: readme
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Marvin Preuss 2021-09-01 13:43:50 +02:00
parent 94b6ada40d
commit f9038b02f6
3 changed files with 12 additions and 6 deletions

BIN
README.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -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 This could be a command to run (like ssh) or a `db.Ping()` for check of the readiness
of a database container. of a database container.
![readme](./README.gif)
## Use as commandline tool ## Use as commandline tool
Download the tool from the [download page](https://github.com/xsteadfastx/don/releases) or Download the tool from the [download page](https://github.com/xsteadfastx/don/releases) or
@ -52,8 +54,9 @@ if err := don.Ready(
return true return true
}, },
10*time.Minute, 10*time.Minute, // When to timeout completly.
30*time.Second, 30*time.Second, // Whats the time between retries.
false, // If you want a progressbar.
); err != nil { ); err != nil {
log.Error().Err(err).Msg("received error") log.Error().Err(err).Msg("received error")
teardown(pool, resource, tmpState.Name()) teardown(pool, resource, tmpState.Name())
@ -63,14 +66,14 @@ if err := don.Ready(
## Functions ## Functions
### func [Cmd](/don.go#L69) ### func [Cmd](/don.go#L72)
`func Cmd(c string) func() bool` `func Cmd(c string) func() bool`
Cmd returns a `func() bool` for working with `don.Ready()`. It executes a command and 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. 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` `func Ready(f func() bool, timeout time.Duration, retry time.Duration, bar bool) error`

7
don.go
View File

@ -2,6 +2,8 @@
// This could be a command to run (like ssh) or a `db.Ping()` for check of the readiness // This could be a command to run (like ssh) or a `db.Ping()` for check of the readiness
// of a database container. // of a database container.
// //
// (image/readme) ./README.gif
//
// Use as commandline tool // Use as commandline tool
// //
// Download the tool from the (download page) https://github.com/xsteadfastx/don/releases or // Download the tool from the (download page) https://github.com/xsteadfastx/don/releases or
@ -42,8 +44,9 @@
// //
// return true // return true
// }, // },
// 10*time.Minute, // 10*time.Minute, // When to timeout completly.
// 30*time.Second, // 30*time.Second, // Whats the time between retries.
// false, // If you want a progressbar.
// ); err != nil { // ); err != nil {
// log.Error().Err(err).Msg("received error") // log.Error().Err(err).Msg("received error")
// teardown(pool, resource, tmpState.Name()) // teardown(pool, resource, tmpState.Name())