cluster

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnableCluster bool // 是否开启多节点模式

)

Functions

func IsLeader

func IsLeader() bool

IsLeader 判断当前节点类型,true为master,false为slave

func RunWithLeader

func RunWithLeader(ch chan bool, ctx context.Context, call func(ctx context.Context))

RunWithLeader 运行函数,当有master和slave的时候,只有master才能运行函数

func SetLeader

func SetLeader(leader bool)

SetLeader 设置当前节点类型,true为master,false为slave

Types

This section is empty.

Directories

Path Synopsis
etcd
nacos
zookeeper

Jump to

Keyboard shortcuts

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