UNPKG

@itwin/object-storage-google

Version:

Object storage implementation using Google Cloud Storage

23 lines 1.78 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.GoogleClientStorageBindings = void 0; const internal_1 = require("@itwin/object-storage-core/lib/server/internal"); const object_storage_core_1 = require("@itwin/object-storage-core"); const common_1 = require("../common"); const GoogleClientStorage_1 = require("./GoogleClientStorage"); const wrappers_1 = require("./wrappers"); class GoogleClientStorageBindings extends object_storage_core_1.ClientStorageDependency { dependencyName = common_1.Constants.storageType; register(container, config) { container.registerInstance(common_1.Types.GoogleClient.config, config ?? { dependencyName: common_1.Constants.storageType }); container.registerFactory(wrappers_1.ClientStorageWrapperFactory, (c) => new wrappers_1.ClientStorageWrapperFactory(c.resolve(common_1.Types.GoogleClient.config).retryOptions)); container.registerFactory(internal_1.UrlTransferClient, (c) => new internal_1.UrlTransferClient(c.resolve(common_1.Types.GoogleClient.config).retryOptions)); container.registerFactory(object_storage_core_1.Types.Client.clientStorage, (c) => new GoogleClientStorage_1.GoogleClientStorage(c.resolve(wrappers_1.ClientStorageWrapperFactory), c.resolve(internal_1.UrlTransferClient))); } } exports.GoogleClientStorageBindings = GoogleClientStorageBindings; //# sourceMappingURL=GoogleClientStorageBindings.js.map