Table of Contents

Method ReadAsync

Namespace
MailFathom.Infrastructure.Persistence.Settings
Assembly
MailFathom.Infrastructure.dll

ReadAsync(PostgresConnectionSettings, SecretValueInterpretation, TimeSpan, CancellationToken)

Reads the deployment's persisted configuration document.

public static Task<RootSettingsDocument> ReadAsync(PostgresConnectionSettings connectionSettings, SecretValueInterpretation interpretation, TimeSpan commandTimeout, CancellationToken cancellationToken)

Parameters

connectionSettings PostgresConnectionSettings

Where the connection string and its credential come from, read from the sources beneath this layer.

interpretation SecretValueInterpretation

How the deployment's configured secret-bearing values are interpreted.

commandTimeout TimeSpan

How long the single read may run before the driver cancels it.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<RootSettingsDocument>

The document and the version it was read at.

Exceptions

ArgumentNullException

Thrown when connectionSettings is null.

ArgumentOutOfRangeException

Thrown when interpretation is not a supported mode, or commandTimeout is not positive.

InvalidOperationException

Thrown when the configured connection settings do not describe a database that can be opened.

RootSettingsUnreadableException

Thrown when the persisted configuration cannot be read at all.