コード例 #1
0
        public ConfigServiceV2ClientImpl(ConfigServiceV2.ConfigServiceV2Client grpcClient, ConfigServiceV2Settings settings)
        {
            this.GrpcClient = grpcClient;
            ConfigServiceV2Settings effectiveSettings = settings ?? ConfigServiceV2Settings.GetDefault();

            _clientHelper  = new ClientHelper(effectiveSettings);
            _callListSinks = _clientHelper.BuildApiCall <ListSinksRequest, ListSinksResponse>(
                GrpcClient.ListSinksAsync, GrpcClient.ListSinks, effectiveSettings.ListSinksSettings);
            _callGetSink = _clientHelper.BuildApiCall <GetSinkRequest, LogSink>(
                GrpcClient.GetSinkAsync, GrpcClient.GetSink, effectiveSettings.GetSinkSettings);
            _callCreateSink = _clientHelper.BuildApiCall <CreateSinkRequest, LogSink>(
                GrpcClient.CreateSinkAsync, GrpcClient.CreateSink, effectiveSettings.CreateSinkSettings);
            _callUpdateSink = _clientHelper.BuildApiCall <UpdateSinkRequest, LogSink>(
                GrpcClient.UpdateSinkAsync, GrpcClient.UpdateSink, effectiveSettings.UpdateSinkSettings);
            _callDeleteSink = _clientHelper.BuildApiCall <DeleteSinkRequest, Empty>(
                GrpcClient.DeleteSinkAsync, GrpcClient.DeleteSink, effectiveSettings.DeleteSinkSettings);
        }
コード例 #2
0
        public ConfigServiceV2ClientImpl(ConfigServiceV2.IConfigServiceV2Client grpcClient, ConfigServiceV2Settings settings)
        {
            this.GrpcClient = grpcClient;
            ConfigServiceV2Settings effectiveSettings = settings ?? ConfigServiceV2Settings.GetDefault();
            IClock effectiveClock = effectiveSettings.Clock ?? SystemClock.Instance;

            _clientHelper  = new ClientHelper(effectiveSettings);
            _callListSinks = _clientHelper.BuildApiCall <ListSinksRequest, ListSinksResponse>(GrpcClient.ListSinksAsync, GrpcClient.ListSinks)
                             .WithRetry(effectiveSettings.ListSinksRetry, effectiveClock, null);
            _callGetSink = _clientHelper.BuildApiCall <GetSinkRequest, LogSink>(GrpcClient.GetSinkAsync, GrpcClient.GetSink)
                           .WithRetry(effectiveSettings.GetSinkRetry, effectiveClock, null);
            _callCreateSink = _clientHelper.BuildApiCall <CreateSinkRequest, LogSink>(GrpcClient.CreateSinkAsync, GrpcClient.CreateSink)
                              .WithRetry(effectiveSettings.CreateSinkRetry, effectiveClock, null);
            _callUpdateSink = _clientHelper.BuildApiCall <UpdateSinkRequest, LogSink>(GrpcClient.UpdateSinkAsync, GrpcClient.UpdateSink)
                              .WithRetry(effectiveSettings.UpdateSinkRetry, effectiveClock, null);
            _callDeleteSink = _clientHelper.BuildApiCall <DeleteSinkRequest, Empty>(GrpcClient.DeleteSinkAsync, GrpcClient.DeleteSink)
                              .WithRetry(effectiveSettings.DeleteSinkRetry, effectiveClock, null);
        }