package common

type ListenerType int

const (
	ListenerTypeNewServer     = 1 // 服务启动
	ListenerTypeCloseServer   = 2 // 服务关闭
	ListenerTypeNewInstance   = 3 // 副本启动
	ListenerTypeCloseInstance = 4 // 副本关闭
)

var (
	KeyDiscover         = "xh-discover"
	KeyDiscoverService  = KeyDiscover + "/service"
	KeyDiscoverInstance = KeyDiscover + "/instance"
)

var (
	KeyDiscoverServiceNameGateway = "gateway" // 网关服
	KeyDiscoverServiceNameScene   = "scene"   // 场景服
	KeyDiscoverServiceNameUser    = "user"    // 用户中心
)

var (
	KeyDiscoverGateway = KeyDiscoverService + "/" + KeyDiscoverServiceNameGateway // 网关服
	KeyDiscoverScene   = KeyDiscoverService + "/" + KeyDiscoverServiceNameScene   // 场景服
	KeyDiscoverUser    = KeyDiscoverService + "/" + KeyDiscoverServiceNameUser    // 用户中心
)

// ServiceProvider 服务提供者
type ServiceProvider struct {
	Target string
	SID    int64
	Addr   string
}

// InstanceProvider 副本提供者
type InstanceProvider struct {
	InstanceID int   // 副本ID
	UniqueNo   int64 // 副本唯一编号
	SID        string
}
