role

package
v1.20.10 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	CurrentRole RoleType
	// contains filtered or unexported fields
}

func (*Role) GetRole

func (r *Role) GetRole() RoleType

func (*Role) IsMaster

func (r *Role) IsMaster() bool

func (*Role) SetRole

func (r *Role) SetRole(role RoleType)

func (*Role) WatchRole

func (r *Role) WatchRole(zkAddr string, path string) error

type RoleInterface

type RoleInterface interface {
	IsMaster() bool
}

func NewRoleController

func NewRoleController(localIP string, metricPort uint, zkAddr string, watchPath string) (RoleInterface, error)

type RoleType

type RoleType string
const (
	MasterRole RoleType = "Master"
	SlaveRole  RoleType = "Slave"
)

Jump to

Keyboard shortcuts

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