internal static Channel ToClusterChannel(this BigtableCredential credentials)
        {
            // Scope
            var scopedCreds = credentials.GoogleCredentials.CreateScoped(new[] { BigtableConstants.Scopes.ClusterAdmin });

            // Convert
            var channelCreds = scopedCreds.ToChannelCredentials();

            // Connect
            return(new Channel(BigtableConstants.EndPoints.Admin, channelCreds));
        }
        internal static Channel ToReadOnlyDataChannel(this BigtableCredential credentials)
        {
            // Scope
            var scopedCreds = credentials.GoogleCredentials.CreateScoped(new[] { BigtableConstants.Scopes.Readonly });

            // Convert
            var channelCreds = scopedCreds.ToChannelCredentials();

            // Connect
            return(new Channel(BigtableConstants.EndPoints.Data, channelCreds));
        }
Example #3
0
 public BigtableReadonly(BigtableCredential credentials, BigtableConnectionConfig config)
 {
     AdminClient = new Lazy <BigAdminClient>(() => new BigAdminClient(credentials, config));
     DataClient  = new Lazy <BigDataClient>(() => new BigDataClient(credentials, config, true));
 }