示例#1
0
// SaveServiceConfig saves service config into database.
func SaveServiceConfig(serviceId string, conf apis.BinaryMarshaller) error {
	db := db.DatabaseInstance()
	data, _ := conf.Marshal()
	err := db.StoreData(cfgKey(serviceId), data)
	if err != nil {
		log.Error("Failed to save config: %s", err.Error())
		return mpqerr.ServerError("Can not save service data: " + serviceId)
	}
	return nil
}
示例#2
0
// SaveServiceDescription saves service config into database.
func SaveServiceDescription(desc *ServiceDescription) error {
	db := db.DatabaseInstance()
	data, _ := desc.Marshal()
	return db.StoreData(descKey(desc.ServiceId), data)
}