blob: c40d2af523dd6c576edded4503f484cfeaeeaae4 [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 mini_moka.
/// </summary>
public sealed class MiniMokaServiceConfig : IServiceConfig
{
/// <summary>
/// Sets the max capacity of the cache. Refer to [`mini-moka::sync::CacheBuilder::max_capacity`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.max_capacity)
/// </summary>
public long? MaxCapacity { get; init; }
/// <summary>
/// root path of this backend
/// </summary>
public string? Root { get; init; }
/// <summary>
/// Sets the time to idle of the cache. Refer to [`mini-moka::sync::CacheBuilder::time_to_idle`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_idle)
/// </summary>
public string? TimeToIdle { get; init; }
/// <summary>
/// Sets the time to live of the cache. Refer to [`mini-moka::sync::CacheBuilder::time_to_live`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_live)
/// </summary>
public string? TimeToLive { get; init; }
public string Scheme => "mini_moka";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (MaxCapacity is not null)
{
map["max_capacity"] = Utilities.ToOptionString(MaxCapacity);
}
if (Root is not null)
{
map["root"] = Utilities.ToOptionString(Root);
}
if (TimeToIdle is not null)
{
map["time_to_idle"] = Utilities.ToOptionString(TimeToIdle);
}
if (TimeToLive is not null)
{
map["time_to_live"] = Utilities.ToOptionString(TimeToLive);
}
return map;
}
}
}