discovery

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceDiscoverInterval = 5 * time.Second
	ActiveServerQueryURI    = "/worker/v1/appgroup/getLeaderAddr"
)
View Source
const GroupHasChild = 300

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupManager

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

func GetGroupManager

func GetGroupManager() *GroupManager

func (*GroupManager) GetAppKeyByGroupId

func (g *GroupManager) GetAppKeyByGroupId(groupId string) string

func (*GroupManager) GroupId2AppGroupIdMap

func (g *GroupManager) GroupId2AppGroupIdMap() map[string]int64

func (*GroupManager) IsAdvancedVersion added in v0.0.2

func (g *GroupManager) IsAdvancedVersion(groupId string) bool

func (*GroupManager) StartServerDiscovery

func (g *GroupManager) StartServerDiscovery(groupId, appKey string)

func (*GroupManager) Stop

func (g *GroupManager) Stop()

type ServiceDiscover

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

func GetDiscovery

func GetDiscovery(groupId string) *ServiceDiscover

func NewServiceDiscovery

func NewServiceDiscovery() *ServiceDiscover

func (*ServiceDiscover) ActiveServer

func (s *ServiceDiscover) ActiveServer() string

func (*ServiceDiscover) ResultChangedCh

func (s *ServiceDiscover) ResultChangedCh() chan struct{}

func (*ServiceDiscover) Start

func (s *ServiceDiscover) Start(groupId, appKey string)

func (*ServiceDiscover) Stop

func (s *ServiceDiscover) Stop(stop <-chan struct{})

type TriggerEvent

type TriggerEvent struct {
	ChildGroupId  string
	ChildAppKey   string
	ParentGroupId string
}

Jump to

Keyboard shortcuts

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