Help us shape the future of Go! Take the 2026 Go Developer Survey

wait

package
v1.20.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TimeoutConfigDefault is the default timeout configuration.
	TimeoutConfigDefault = TimeoutConfig{
		ClusterMeshSyncTimeout: 1 * time.Minute,
	}

	// ErrRemoteClusterDisconnected is the error returned by wait for sync
	// operations if the remote cluster is disconnected while still waiting.
	ErrRemoteClusterDisconnected = errors.New("remote cluster disconnected")
)

Functions

func ForAll added in v1.16.0

func ForAll(ctx context.Context, waiters []Fn) error

ForAll returns after the all of the provided waiters have been executed.

Types

type Fn added in v1.16.0

type Fn func(ctx context.Context) error

Fn is the type of a function to wait for the initial synchronization of a given resource type from all remote clusters.

type SyncedCommon added in v1.16.0

type SyncedCommon struct {
	// contains filtered or unexported fields
}

SyncedCommon contains common fields and methods used for tracking the synchronization status of a remote cluster.

func NewSyncedCommon added in v1.16.0

func NewSyncedCommon() SyncedCommon

NewSyncedCommon returns a new SyncedCommon instance.

func (*SyncedCommon) Stop added in v1.16.0

func (sc *SyncedCommon) Stop()

func (*SyncedCommon) Wait added in v1.16.0

func (sc *SyncedCommon) Wait(ctx context.Context, chs ...<-chan struct{}) error

Wait returns after all of the given channels have been closed, the remote cluster has been disconnected, or the given context has been cancelled.

type TimeoutConfig

type TimeoutConfig struct {
	// ClusterMeshSyncTimeout is the timeout when waiting for the initial
	// synchronization from all remote clusters, before triggering the
	// circuit breaker and possibly disrupting cross-cluster connections.
	ClusterMeshSyncTimeout time.Duration
}

func (TimeoutConfig) Flags

func (def TimeoutConfig) Flags(flags *pflag.FlagSet)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL