watch

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdShardWatch

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

EtcdShardWatch used to watch the distributed lock of shard, and provide the corresponding callback function.

func (*EtcdShardWatch) RegisteringEventCallback

func (w *EtcdShardWatch) RegisteringEventCallback(eventCallback ShardEventCallback)

func (*EtcdShardWatch) Start

func (w *EtcdShardWatch) Start(ctx context.Context) error

func (*EtcdShardWatch) Stop

func (w *EtcdShardWatch) Stop(_ context.Context) error

type NoopShardWatch

type NoopShardWatch struct{}

func (NoopShardWatch) RegisteringEventCallback

func (n NoopShardWatch) RegisteringEventCallback(_ ShardEventCallback)

func (NoopShardWatch) Start

func (n NoopShardWatch) Start(_ context.Context) error

func (NoopShardWatch) Stop

func (n NoopShardWatch) Stop(_ context.Context) error

type ShardEventCallback

type ShardEventCallback interface {
	OnShardRegistered(ctx context.Context, event ShardRegisterEvent) error
	OnShardExpired(ctx context.Context, event ShardExpireEvent) error
}

type ShardExpireEvent

type ShardExpireEvent struct {
	ShardID       storage.ShardID
	OldLeaderNode string
	// contains filtered or unexported fields
}

type ShardRegisterEvent

type ShardRegisterEvent struct {
	ShardID       storage.ShardID
	NewLeaderNode string
	// contains filtered or unexported fields
}

type ShardWatch

type ShardWatch interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	RegisteringEventCallback(eventCallback ShardEventCallback)
}

func NewEtcdShardWatch

func NewEtcdShardWatch(logger *zap.Logger, clusterName string, rootPath string, client *clientv3.Client) ShardWatch

func NewNoopShardWatch

func NewNoopShardWatch() ShardWatch

Jump to

Keyboard shortcuts

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