Compare commits

..

No commits in common. "main" and "v1.2.0" have entirely different histories.
main ... v1.2.0

4 changed files with 6 additions and 13 deletions

View File

@ -11,7 +11,6 @@ builds:
goos: goos:
- linux - linux
- darwin
goarch: goarch:
- amd64 - amd64

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@ -7,8 +7,6 @@ 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
@ -54,9 +52,8 @@ if err := don.Ready(
return true return true
}, },
10*time.Minute, // When to timeout completly. 10*time.Minute,
30*time.Second, // Whats the time between retries. 30*time.Second,
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())
@ -66,14 +63,14 @@ if err := don.Ready(
## Functions ## Functions
### func [Cmd](/don.go#L72) ### func [Cmd](/don.go#L69)
`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#L90) ### func [Ready](/don.go#L87)
`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,8 +2,6 @@
// 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
@ -44,9 +42,8 @@
// //
// return true // return true
// }, // },
// 10*time.Minute, // When to timeout completly. // 10*time.Minute,
// 30*time.Second, // Whats the time between retries. // 30*time.Second,
// 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())