Class ConfigSource<T>
Abstract configuration source.
Inherited Members
Namespace: Cognite.Extractor.Utils.Unstable.Configuration
Assembly: ExtractorUtils.dll
Syntax
public abstract class ConfigSource<T> where T : VersionedConfig
Type Parameters
| Name | Description |
|---|---|
| T | Type of config object to load. |
Properties
| Edit this page View SourceConfig
Current configuration object, if fetched.
Declaration
public T? Config { get; protected set; }
Property Value
| Type | Description |
|---|---|
| T |
Revision
Current revision, null if a local revision is active.
Declaration
public int? Revision { get; protected set; }
Property Value
| Type | Description |
|---|---|
| int? |
Methods
| Edit this page View SourceGetConfigWrapper()
Get a wrapper around configuration with information about the remote revision if applicable. This will fail if a config has not been loaded.
Declaration
public abstract ConfigWrapper<T> GetConfigWrapper()
Returns
| Type | Description |
|---|---|
| ConfigWrapper<T> |
ReadLocalFile(string)
Read a file from the local filesystem to a string.
Declaration
protected Task<string> ReadLocalFile(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the local file |
Returns
| Type | Description |
|---|---|
| Task<string> | File as a string |
ResolveConfig(int?, BaseErrorReporter, CancellationToken)
Load configuration, either from a local file or from CDF.
Declaration
public abstract Task<bool> ResolveConfig(int? targetRevision, BaseErrorReporter reporter, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | targetRevision | Revision to load. Ignored for local config. Null means load the latest. |
| BaseErrorReporter | reporter | Error reporter for writing configuration errors to CDF. |
| CancellationToken | token | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if a new configuration file was loaded, false otherwise. |