Skip to content

RemoteCatalogFetcher ​

Category: Catalog

Source: remote_catalog_fetcher.dart

Fetches a remote catalog YAML and returns a sanitized payload, never throwing.

Failure cases (timeout, network error, non-2xx, parse error upstream) are returned as [FetchFailed] values so the caller can decide whether to log.

Classes ​

sealed FetchResult ​

Constructor ​

dart
const FetchResult()

FetchUpdated ​

Constructor ​

dart
const FetchUpdated({required this.yaml, this.etag, this.lastModified})

Properties ​

PropertyTypeDescription
yamlStringSanitized YAML payload (credentials stripped).
etagString?
lastModifiedString?

FetchNotModified ​

Constructor ​

dart
const FetchNotModified()

FetchFailed ​

Constructor ​

dart
const FetchFailed({required this.reason})

Properties ​

PropertyTypeDescription
reasonString

RemoteCatalogFetcher ​

Constructor ​

dart
RemoteCatalogFetcher({http.Client? client})

Methods ​

`Future<FetchResult> fetch( ​
Uri uri, {
String? ifModifiedSince,
Duration timeout = const Duration(seconds: 10),

})`

Released under the MIT License.