package com

import (
	"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(completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
	if event.Type == clientv3.EventTypeDelete {
		return
	}
	PlatformConfigSingleton.Update(data)
}
