leader

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module handles all the leader tasks

func New

func New(nodeID string, module *pubsub.Module) *Module

New initializes leader module

func (*Module) AddCallBack

func (s *Module) AddCallBack(id string, cb func())

AddCallBack adds a call back function

func (*Module) GetLeaderNodeID

func (s *Module) GetLeaderNodeID(ctx context.Context) (string, error)

GetLeaderNodeID gets leader node id

func (*Module) IsLeader

func (s *Module) IsLeader(ctx context.Context, nodeID string) (bool, error)

IsLeader checks if the provided node id is the leader gateway or not

func (*Module) RemoveCallBack

func (s *Module) RemoveCallBack(id string)

RemoveCallBack removes a call back function

Jump to

Keyboard shortcuts

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