本文整理汇总了TypeScript中wicked-sdk.ErrorCallback类的典型用法代码示例。如果您正苦于以下问题:TypeScript ErrorCallback类的具体用法?TypeScript ErrorCallback怎么用?TypeScript ErrorCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ErrorCallback类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updateKongConsumer
function updateKongConsumer(portalConsumer: ConsumerInfo, kongConsumer: ConsumerInfo, callback: ErrorCallback) {
// The only thing which may differ here is the custom_id
if (portalConsumer.consumer.custom_id === kongConsumer.consumer.custom_id) {
debug('Custom ID for consumer username ' + portalConsumer.consumer.username + ' matches: ' + portalConsumer.consumer.custom_id);
return callback(null); // Nothing to do.
}
info('Updating consumer ' + kongConsumer.consumer.id + ' (username ' + kongConsumer.consumer.username + ') with new custom_id: ' + portalConsumer.consumer.custom_id);
utils.kongPatchConsumer(kongConsumer.consumer.id, {
custom_id: portalConsumer.consumer.custom_id
}, callback);
}
示例2: callback
}, function (err) {
if (err)
return callback(err);
if (!consumerData.next) // no next link --> we're done
return callback(null);
// Continue with next batch; get fresh, as we deleted the other ones.
wipeConsumerBatch(consumerUrl, callback);
});
示例3: done
}, function (err, results) {
if (err)
return done(err);
const portalApis = results.portalApis as ApiDescriptionCollection;
const kongApis = results.kongApis as KongApiConfigCollection;
const todoLists = assembleApiTodoLists(portalApis, kongApis);
debug('Infos on sync APIs todo list:');
debug(' add items: ' + todoLists.addList.length);
debug(' update items: ' + todoLists.updateList.length);
debug(' delete items: ' + todoLists.deleteList.length);
//debug(utils.getText(todoLists));
async.series({
updateApis: function (callback) {
// Will call syncPlugins
kong.updateKongApis(sync, todoLists.updateList, callback);
},
deleteApis: function (callback) {
kong.deleteKongApis(todoLists.deleteList, callback);
},
addApis: function (callback) {
kong.addKongApis(todoLists.addList, callback);
}
}, function (err) {
if (err)
return done(err);
debug("syncApis() finished.");
return done(null);
});
});
示例4: callback
kongGetRouteForService(apiId, function (err, route) {
if (err)
return callback(err);
kongDeleteRoute(route.id, function (err) {
if (err)
return callback(err);
kongDeleteService(apiId, callback);
})
});
示例5: callback
kong.getKongConsumers(portalConsumers, function (err, resultConsumers) {
if (err)
return callback(err);
const kongConsumers = [] as ConsumerInfo[];
for (let i = 0; i < resultConsumers.length; ++i) {
if (resultConsumers[i])
kongConsumers.push(resultConsumers[i]);
}
syncConsumers(portalConsumers, kongConsumers, callback);
});