election

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID_ITEM_NUM = 4
)

Variables

This section is empty.

Functions

func GetAcquireTime

func GetAcquireTime() int64

func GetLeader

func GetLeader() string

func IsMasterController

func IsMasterController() (bool, error)

功能:判断当前控制器是否为masterController

func IsMasterControllerAndReturnIP

func IsMasterControllerAndReturnIP() (bool, string, error)

func Start

func Start(ctx context.Context, cfg *config.ControllerConfig)

Types

type LeaderData

type LeaderData struct {
	sync.RWMutex
	Name string
	// contains filtered or unexported fields
}

func (*LeaderData) GetLeader

func (l *LeaderData) GetLeader() string

func (*LeaderData) SetLeader

func (l *LeaderData) SetLeader(name string)

Jump to

Keyboard shortcuts

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