blob: 149b2896ce0e5cc2627fec28bd03b42f4f9d503f [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 moka.
/// </summary>
public sealed class MokaServiceConfig : IServiceConfig
{
/// <summary>
/// Sets the max capacity of the cache. Refer to [`moka::future::CacheBuilder::max_capacity`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.max_capacity)
/// </summary>
public long? MaxCapacity { get; init; }
/// <summary>
/// Name for this cache instance.
/// </summary>
public string? Name { 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 [`moka::future::CacheBuilder::time_to_idle`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_idle)
/// </summary>
public string? TimeToIdle { get; init; }
/// <summary>
/// Sets the time to live of the cache. Refer to [`moka::future::CacheBuilder::time_to_live`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_live)
/// </summary>
public string? TimeToLive { get; init; }
public string Scheme => "moka";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (MaxCapacity is not null)
{
map["max_capacity"] = Utilities.ToOptionString(MaxCapacity);
}
if (Name is not null)
{
map["name"] = Utilities.ToOptionString(Name);
}
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;
}
}
}