Table of Contents

Class FileRemoteConfigSource

Namespace
JD.AI.Core.Config
Assembly
JD.AI.Core.dll

Reads configuration from a file on disk, designed for Kubernetes ConfigMap volume mounts or any mounted config file that may be updated externally. Detects changes via SHA-256 content hashing.

public sealed class FileRemoteConfigSource : IRemoteConfigSource
Inheritance
FileRemoteConfigSource
Implements
Inherited Members

Constructors

FileRemoteConfigSource(string, ILogger?)

public FileRemoteConfigSource(string filePath, ILogger? logger = null)

Parameters

filePath string

Path to the configuration file.

logger ILogger

Optional logger.

Properties

Name

Human-readable name of this config source (e.g. "consul", "http", "k8s-configmap").

public string Name { get; }

Property Value

string

Methods

FetchAsync(CancellationToken)

Fetches the current configuration content from the remote source. Returns null if the source is unreachable or has no content.

public Task<RemoteConfigResult?> FetchAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<RemoteConfigResult>