當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript wicked-sdk.ErrorCallback類代碼示例

本文整理匯總了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);
}
開發者ID:Haufe-Lexware,項目名稱:wicked.portal-kong-adapter,代碼行數:11,代碼來源:kong.ts

示例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);
        });
開發者ID:Haufe-Lexware,項目名稱:wicked.portal-kong-adapter,代碼行數:9,代碼來源:kong.ts

示例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);
            });
        });
開發者ID:Haufe-Lexware,項目名稱:wicked.portal-kong-adapter,代碼行數:31,代碼來源:sync.ts

示例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);
     })
 });
開發者ID:Haufe-Lexware,項目名稱:wicked.portal-kong-adapter,代碼行數:9,代碼來源:utils.ts

示例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);
 });
開發者ID:Haufe-Lexware,項目名稱:wicked.portal-kong-adapter,代碼行數:10,代碼來源:sync.ts


注:本文中的wicked-sdk.ErrorCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。