blob: 5d2d484c1e219f5c41d9b5ac2d2a55b0bd450334 [file]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/dotnet.rs.
using OpenDAL.ServiceConfig.Abstractions;
namespace OpenDAL.ServiceConfig
{
/// <summary>
/// Configuration for service tikv.
/// </summary>
public sealed class TikvServiceConfig : IServiceConfig
{
/// <summary>
/// certificate authority file path
/// </summary>
public string? CaPath { get; init; }
/// <summary>
/// cert path
/// </summary>
public string? CertPath { get; init; }
/// <summary>
/// network address of the TiKV service.
/// </summary>
public IReadOnlyList<string>? Endpoints { get; init; }
/// <summary>
/// whether using insecure connection to TiKV
/// </summary>
public bool? Insecure { get; init; }
/// <summary>
/// key path
/// </summary>
public string? KeyPath { get; init; }
public string Scheme => "tikv";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (CaPath is not null)
{
map["ca_path"] = Utilities.ToOptionString(CaPath);
}
if (CertPath is not null)
{
map["cert_path"] = Utilities.ToOptionString(CertPath);
}
if (Endpoints is not null)
{
map["endpoints"] = string.Join(",", Endpoints);
}
if (Insecure is not null)
{
map["insecure"] = Utilities.ToOptionString(Insecure);
}
if (KeyPath is not null)
{
map["key_path"] = Utilities.ToOptionString(KeyPath);
}
return map;
}
}
}