本文整理匯總了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);
});