| /* |
| * 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 goosefs. |
| /// </summary> |
| public sealed class GoosefsServiceConfig : IServiceConfig |
| { |
| /// <summary> |
| /// Authentication type. Supported values: `"nosasl"`, `"simple"`. Default: `"simple"` โ PLAIN SASL with username. `"nosasl"` โ skip authentication entirely. |
| /// </summary> |
| public string? AuthType { get; init; } |
| /// <summary> |
| /// Authentication username. Used in SIMPLE mode as the login identity. Default: current OS user (`$USER` / `$USERNAME`). |
| /// </summary> |
| public string? AuthUsername { get; init; } |
| /// <summary> |
| /// Block size in bytes for new files (default: 64 MiB). |
| /// </summary> |
| public long? BlockSize { get; init; } |
| /// <summary> |
| /// Chunk size in bytes for streaming RPCs (default: 1 MiB). |
| /// </summary> |
| public long? ChunkSize { get; init; } |
| /// <summary> |
| /// Master address(es) in `host:port` format. For single master: `"10.0.0.1:9200"` For HA (comma-separated): `"10.0.0.1:9200,10.0.0.2:9200,10.0.0.3:9200"` When multiple addresses are provided, the client uses `PollingMasterInquireClient` to discover the Primary Master automatically. Resolution precedence at `build()` time (highest โ lowest), following [goosefs-sdk `docs/CLIENT_CONFIGURATION.md`](https://github.com/Tencent/tencent-goosefs-rust-sdk/blob/main/docs/CLIENT_CONFIGURATION.md) ยง1: 1. `GOOSEFS_MASTER_ADDR` environment variable 2. `goosefs.master.rpc.addresses` / `goosefs.master.hostname` in `goosefs-site.properties` 3. This field (from the builder, the OpenDAL config map, or the URI authority of `goosefs://host:port/path`) A site file that declares masters therefore outranks this field: the file carries the deployment's whole HA master list, which a single URI authority cannot express. Set `GOOSEFS_MASTER_ADDR` to override a deployed site file for one process. `build()` fails with `ConfigInvalid` when **none** of the above supplies a master address. |
| /// </summary> |
| public string? MasterAddr { get; init; } |
| /// <summary> |
| /// Root path of this backend. All operations will happen under this root. Default to `/` if not set. |
| /// </summary> |
| public string? Root { get; init; } |
| /// <summary> |
| /// Default write type for new files. Supported values: `"must_cache"`, `"cache_through"`, `"through"`, `"async_through"`. Default: `"must_cache"`. |
| /// </summary> |
| public string? WriteType { get; init; } |
| |
| public string Scheme => "goosefs"; |
| |
| public IReadOnlyDictionary<string, string> ToOptions() |
| { |
| var map = new Dictionary<string, string>(); |
| if (AuthType is not null) |
| { |
| map["auth_type"] = Utilities.ToOptionString(AuthType); |
| } |
| if (AuthUsername is not null) |
| { |
| map["auth_username"] = Utilities.ToOptionString(AuthUsername); |
| } |
| if (BlockSize is not null) |
| { |
| map["block_size"] = Utilities.ToOptionString(BlockSize); |
| } |
| if (ChunkSize is not null) |
| { |
| map["chunk_size"] = Utilities.ToOptionString(ChunkSize); |
| } |
| if (MasterAddr is not null) |
| { |
| map["master_addr"] = Utilities.ToOptionString(MasterAddr); |
| } |
| if (Root is not null) |
| { |
| map["root"] = Utilities.ToOptionString(Root); |
| } |
| if (WriteType is not null) |
| { |
| map["write_type"] = Utilities.ToOptionString(WriteType); |
| } |
| return map; |
| } |
| } |
| |
| } |