23 lines
472 B
Go
23 lines
472 B
Go
package com
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.etcd.io/etcd/client/v3"
|
|
|
|
"mongo.games.com/game/etcd"
|
|
"mongo.games.com/game/protocol/webapi"
|
|
)
|
|
|
|
func init() {
|
|
// 平台信息
|
|
etcd.Register(etcd.ETCDKEY_PLATFORM_PREFIX, webapi.Platform{}, PlatformConfigEtcd)
|
|
}
|
|
|
|
func PlatformConfigEtcd(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
|
if event.Type == clientv3.EventTypeDelete {
|
|
return
|
|
}
|
|
PlatformConfigSingleton.Update(data)
|
|
}
|