exoscale / egoscale

exoscale golang bindings
https://pkg.go.dev/github.com/exoscale/egoscale/v3
Apache License 2.0
31 stars 15 forks source link

V3: Async operations helper #590

Closed kobajagi closed 11 months ago

kobajagi commented 11 months ago

Helper that waits on async operation to complete.

Example usage:

    op, err := client.Wait(
        context.Background(),
        func(ctx context.Context) (*oapi.Operation, error) {
            return client.Compute().LoadBalancers().Create(ctx, body)
        },
    )
    if err != nil {
        panic(err)
    }
    fmt.Println(*op.State, *op.Reference.Id)
shortcut-integration[bot] commented 11 months ago

This pull request has been linked to Shortcut Story #71885: Async operations helper.