本文整理汇总了TypeScript中wicked-sdk.ErrorCallback.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ErrorCallback.default方法的具体用法?TypeScript ErrorCallback.default怎么用?TypeScript ErrorCallback.default使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wicked-sdk.ErrorCallback
的用法示例。
在下文中一共展示了ErrorCallback.default方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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);
});
示例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: 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);
}