Documentation ¶
Index ¶
- func ResourceHasState[T fmt.Stringer](ctx context.Context, validStates, badStates []T, ...) retry.CheckFn
- func ResourceIsAvailable(ctx context.Context, fn func(ctx context.Context) error) retry.CheckFn
- func ResourceIsGone(ctx context.Context, fn func(ctx context.Context) error) retry.CheckFn
- type ResourceGetter
- type Waiter
- func (w *Waiter) UntilAliasAvailable(ctx context.Context, workspace, alias string) error
- func (w *Waiter) UntilAliasGone(ctx context.Context, workspace, alias string) error
- func (w *Waiter) UntilCollectionGone(ctx context.Context, workspace, name string) error
- func (w *Waiter) UntilCollectionHasDocuments(ctx context.Context, workspace, name string, count int64) error
- func (w *Waiter) UntilCollectionHasNewDocuments(ctx context.Context, workspace, name string, count int64) error
- func (w *Waiter) UntilCollectionReady(ctx context.Context, workspace, name string) error
- func (w *Waiter) UntilKafkaIntegrationActive(ctx context.Context, integration string) error
- func (w *Waiter) UntilMountActive(ctx context.Context, vID, workspace, collection string) error
- func (w *Waiter) UntilMountGone(ctx context.Context, vID, workspace, collection string) error
- func (w *Waiter) UntilQueryDone(ctx context.Context, queryID string) error
- func (w *Waiter) UntilQueryLambdaTagPropagated(ctx context.Context, workspace, name, tag string) error
- func (w *Waiter) UntilQueryLambdaVersionActive(ctx context.Context, workspace, name, version string) error
- func (w *Waiter) UntilQueryLambdaVersionGone(ctx context.Context, workspace, name, version string) error
- func (w *Waiter) UntilQueryable(ctx context.Context, workspace, name string, offsets []string) error
- func (w *Waiter) UntilScheduledLambdaAvailable(ctx context.Context, workspace, scheduledLambdaRRN string) error
- func (w *Waiter) UntilScheduledLambdaGone(ctx context.Context, workspace, scheduledLambdaRRN string) error
- func (w *Waiter) UntilViewGone(ctx context.Context, workspace, name string) error
- func (w *Waiter) UntilVirtualInstanceActive(ctx context.Context, id string) error
- func (w *Waiter) UntilVirtualInstanceGone(ctx context.Context, id string) error
- func (w *Waiter) UntilVirtualInstanceSuspended(ctx context.Context, id string) error
- func (w *Waiter) UntilWorkspaceAvailable(ctx context.Context, workspace string) error
- func (w *Waiter) UntilWorkspaceGone(ctx context.Context, workspace string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResourceHasState ¶
func ResourceHasState[T fmt.Stringer](ctx context.Context, validStates, badStates []T, fn func(ctx context.Context) (T, error)) retry.CheckFn
ResourceHasState implements RetryFn to wait until the resource has the desired state, and if a bad state is encountered it will return ErrBadWaitState
func ResourceIsAvailable ¶
ResourceIsAvailable implements RetryFn to wait until the resource is present
Types ¶
type ResourceGetter ¶
type ResourceGetter interface { retry.Retrier GetAlias(ctx context.Context, workspace string, name string) (openapi.Alias, error) GetCollection(ctx context.Context, workspace string, name string) (openapi.Collection, error) GetCollectionCommit(ctx context.Context, workspace string, name string, offsets []string) (openapi.GetCollectionCommitData, error) GetCollectionMount(ctx context.Context, id, collectionPath string) (openapi.CollectionMount, error) GetIntegration(ctx context.Context, name string) (openapi.Integration, error) GetQueryInfo(ctx context.Context, queryID string) (openapi.QueryInfo, error) GetQueryLambdaVersion(ctx context.Context, workspace, name, version string) (openapi.QueryLambdaVersion, error) GetView(ctx context.Context, workspace, name string) (openapi.View, error) GetVirtualInstance(ctx context.Context, id string) (openapi.VirtualInstance, error) GetWorkspace(ctx context.Context, name string) (openapi.Workspace, error) GetScheduledLambda(ctx context.Context, workspace, scheduledLambdaRRN string) (openapi.ScheduledLambda, error) }
type Waiter ¶
type Waiter struct { QueryLambdaTagPropagation time.Duration // contains filtered or unexported fields }
func New ¶
func New(rs ResourceGetter) *Waiter
func (*Waiter) UntilAliasAvailable ¶
UntilAliasAvailable waits until the alias is available.
func (*Waiter) UntilAliasGone ¶
UntilAliasGone waits until the alias is gone.
func (*Waiter) UntilCollectionGone ¶
UntilCollectionGone waits until a collection marked for deletion is gone, i.e. GetCollection() returns "not found".
func (*Waiter) UntilCollectionHasDocuments ¶
func (w *Waiter) UntilCollectionHasDocuments(ctx context.Context, workspace, name string, count int64) error
UntilCollectionHasDocuments waits until the collection has at least count documents
func (*Waiter) UntilCollectionHasNewDocuments ¶
func (w *Waiter) UntilCollectionHasNewDocuments(ctx context.Context, workspace, name string, count int64) error
UntilCollectionHasNewDocuments waits until the collection has at least count new documents (measured from when the method is called).
func (*Waiter) UntilCollectionReady ¶
UntilCollectionReady waits until the collection is ready.
func (*Waiter) UntilKafkaIntegrationActive ¶
UntilKafkaIntegrationActive waits until all topics in a Kafka integration are in ACTIVE state.
func (*Waiter) UntilMountActive ¶
UntilMountActive waits until the collection mount is active, and queries can be issued to it on the virtual instance.
func (*Waiter) UntilMountGone ¶ added in v0.22.1
UntilMountGone waits until the collection mount is gone.
func (*Waiter) UntilQueryDone ¶
UntilQueryDone waits until queryID has either completed. Returns ErrBadWaitState if the query failed or was cancelled.
func (*Waiter) UntilQueryLambdaTagPropagated ¶ added in v0.22.5
func (w *Waiter) UntilQueryLambdaTagPropagated(ctx context.Context, workspace, name, tag string) error
UntilQueryLambdaTagPropagated waits until the query lambda tag has been propagated throughout the system.
func (*Waiter) UntilQueryLambdaVersionActive ¶ added in v0.22.4
func (w *Waiter) UntilQueryLambdaVersionActive(ctx context.Context, workspace, name, version string) error
UntilQueryLambdaVersionActive waits until the query lambda version is active. Returns an error if the query lambda contains invalid SQL.
func (*Waiter) UntilQueryLambdaVersionGone ¶ added in v0.22.4
func (w *Waiter) UntilQueryLambdaVersionGone(ctx context.Context, workspace, name, version string) error
UntilQueryLambdaVersionGone waits until a query lambda is deleted, i.e. GetQueryLambda() returns "not found".
func (*Waiter) UntilQueryable ¶ added in v0.23.0
func (w *Waiter) UntilQueryable(ctx context.Context, workspace, name string, offsets []string) error
UntilQueryable waits until the collection includes the documents at or after the specified offset(s).
func (*Waiter) UntilScheduledLambdaAvailable ¶ added in v0.24.2
func (w *Waiter) UntilScheduledLambdaAvailable(ctx context.Context, workspace, scheduledLambdaRRN string) error
UntilScheduledLambdaAvailable waits until the scheduledLambda is available.
func (*Waiter) UntilScheduledLambdaGone ¶ added in v0.24.2
func (w *Waiter) UntilScheduledLambdaGone(ctx context.Context, workspace, scheduledLambdaRRN string) error
UntilScheduledLambdaGone waits until the scheduledLambda is gone.
func (*Waiter) UntilViewGone ¶
UntilViewGone waits until a view marked for deletion is gone, i.e. GetView() returns "not found".
func (*Waiter) UntilVirtualInstanceActive ¶
UntilVirtualInstanceActive waits until the Virtual Instance is active.
func (*Waiter) UntilVirtualInstanceGone ¶ added in v0.22.1
UntilVirtualInstanceGone waits until the Virtual Instance is gone.
func (*Waiter) UntilVirtualInstanceSuspended ¶
UntilVirtualInstanceSuspended waits until the Virtual Instance is suspended.
func (*Waiter) UntilWorkspaceAvailable ¶
UntilWorkspaceAvailable waits until the workspace is available.