Skip to content

Commit ce43442

Browse files
author
Andrea Scuderi
committed
Improve documentation
1 parent 0a035d5 commit ce43442

18 files changed

+121
-58
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ generate_docc:
5252
preview_docc_lambda_api:
5353
swift package --disable-sandbox preview-documentation --target BreezeLambdaAPI
5454

55+
preview_docc_dynamo_db_service:
56+
swift package --disable-sandbox preview-documentation --target BreezeDynamoDBService
57+
5558
coverage:
5659
llvm-cov export $(TEST_PACKAGE) \
5760
--instr-profile=$(SWIFT_BIN_PATH)/codecov/default.profdata \

Sources/BreezeDynamoDBService/BreezeCodable.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import FoundationEssentials
1818
import Foundation
1919
#endif
2020

21-
/// CodableSendable is a protocol that combines Sendable and Codable.
21+
/// Protocol that combines Sendable and Codable.
2222
public protocol CodableSendable: Sendable, Codable { }
2323

24-
/// BreezeCodable is a protocol that extends CodableSendable to include properties
24+
/// Protocol that extends CodableSendable to include properties
2525
/// for a key, creation date, and update date.
26-
/// It is designed to be used with Breeze services that require these common fields
26+
///
27+
/// BreezeCodable is designed to be used with Breeze services that require these common fields
2728
/// for items stored in a database, such as DynamoDB.
2829
/// - Parameters:
2930
/// - key: A unique identifier for the item.

Sources/BreezeDynamoDBService/BreezeDynamoDBConfig.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
import SotoCore
1616

17-
/// BreezeDynamoDBConfig is a configuration structure for Breeze DynamoDB service.
18-
/// It contains the necessary parameters to connect to a DynamoDB instance, including the region, table name, key name, and an optional endpoint.
17+
/// Configuration structure for Breeze DynamoDB service.
18+
///
19+
/// BreezeDynamoDBConfig contains the necessary parameters to connect to a DynamoDB instance, including the region, table name, key name, and an optional endpoint.
1920
public struct BreezeDynamoDBConfig: Sendable {
2021

2122
/// Initializes a new instance of BreezeDynamoDBConfig.

Sources/BreezeDynamoDBService/BreezeDynamoDBManager.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ import struct Foundation.Date
1616
import NIO
1717
import SotoDynamoDB
1818

19-
/// BreezeDynamoDBManager is a manager for handling DynamoDB operations in Breeze.
20-
/// It provides methods to create, read, update, delete, and list items in a DynamoDB table.
19+
/// Manager for handling DynamoDB operations in Breeze.
20+
///
21+
/// BreezeDynamoDBManager provides methods to create, read, update, delete, and list items in a DynamoDB table.
22+
///
2123
/// It conforms to the BreezeDynamoDBManaging protocol, which defines the necessary operations for Breeze's DynamoDB integration.
22-
/// - Note: This manager requires a DynamoDB instance, a table name, and a key name to operate.
24+
/// - Note: BreezeDynamoDBManager requires a DynamoDB instance, a table name, and a key name to operate.
2325
/// It uses the SotoDynamoDB library to interact with AWS DynamoDB services.
2426
public struct BreezeDynamoDBManager: BreezeDynamoDBManaging {
2527

Sources/BreezeDynamoDBService/BreezeDynamoDBManaging.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import SotoDynamoDB
1616

17-
/// BreezeDynamoDBManaging is a protocol that defines the methods for managing DynamoDB items.
17+
/// Defines the methods for managing DynamoDB items.
1818
public protocol BreezeDynamoDBManaging: Sendable {
1919
/// The keyName is the name of the primary key in the DynamoDB table.
2020
var keyName: String { get }
@@ -53,7 +53,6 @@ public protocol BreezeDynamoDBManaging: Sendable {
5353
/// Deletes an item from the DynamoDB table.
5454
/// - Parameter item: The item to delete, conforming to BreezeCodable.
5555
/// - Throws: An error if the item could not be deleted.
56-
/// - Returns: Void if the item was successfully deleted.
5756
/// - Note:
5857
/// - The item must conform to BreezeCodable.
5958
/// - The item must have the same primary key as an existing item in the table.

Sources/BreezeDynamoDBService/BreezeDynamoDBService.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ import AsyncHTTPClient
1717
import ServiceLifecycle
1818
import Logging
1919

20-
/// BreezeDynamoDBServing
21-
/// A protocol that defines the interface for a Breeze DynamoDB service.
22-
/// It provides methods to access the database manager and to gracefully shutdown the service.
20+
/// Defines the interface for a Breeze DynamoDB service.
21+
///
22+
/// Provides methods to access the database manager and to gracefully shutdown the service.
2323
public protocol BreezeDynamoDBServing: Actor {
2424
func dbManager() async -> BreezeDynamoDBManaging
2525
func gracefulShutdown() throws
2626
}
2727

28-
/// BreezeDynamoDBService is an actor that conforms to the BreezeDynamoDBServing protocol.
29-
/// It provides methods to access the DynamoDB database manager and to gracefully shutdown the service.
28+
/// Provides methods to access the DynamoDB database manager and to gracefully shutdown the service.
3029
public actor BreezeDynamoDBService: BreezeDynamoDBServing {
3130

3231
private let dbManager: BreezeDynamoDBManaging
@@ -84,6 +83,7 @@ public actor BreezeDynamoDBService: BreezeDynamoDBServing {
8483
}
8584

8685
/// Gracefully shutdown the service and its components.
86+
///
8787
/// - Throws: An error if the shutdown process fails.
8888
/// This method ensures that the AWS client and HTTP client are properly shutdown before marking the service as shutdown.
8989
/// It also logs the shutdown process.

Sources/BreezeDynamoDBService/BreezeHTTPClientConfig.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
import Logging
1616
import NIOCore
1717

18-
/// BreezeClientServiceError defines the errors that can occur in the Breeze Client Service.
18+
/// Defines the errors that can occur in the Breeze Client Service.
1919
public enum BreezeClientServiceError: Error {
2020
case invalidHttpClient
2121
}
2222

23-
/// BreezeHTTPClientConfig is a configuration structure for the Breeze HTTP client.
23+
/// Configuration structure for the Breeze HTTP client.
2424
public struct BreezeHTTPClientConfig: Sendable {
2525

2626
/// Initializes a new instance of BreezeHTTPClientConfig.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"theme": {
3+
"color": {
4+
"header": "#DE5E44",
5+
"documentation-intro-title": "#DE5E44",
6+
"documentation-intro-figure": "#DE5E44",
7+
"documentation-intro-accent": "var(--color-header)"
8+
}
9+
}
10+
}

Sources/BreezeDynamoDBService/Foundation+Extension.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import class Foundation.DateFormatter
1616
import struct Foundation.Date
1717
import struct Foundation.TimeZone
1818

19-
/// This file contains extensions for DateFormatter, Date, and String to handle ISO 8601 date formatting and parsing.
19+
/// Entension to DateFormatter to handle ISO 8601.
20+
///
2021
/// These extensions provide a convenient way to convert between `Date` objects and their ISO 8601 string representations.
2122
extension DateFormatter {
2223
static var iso8061: DateFormatter {
@@ -27,6 +28,7 @@ extension DateFormatter {
2728
}
2829
}
2930

31+
/// Entension to Date to handle ISO 8601.
3032
extension Date {
3133
/// Returns a string representation of the date in ISO 8601 format.
3234
var iso8601: String {
@@ -35,6 +37,7 @@ extension Date {
3537
}
3638
}
3739

40+
/// Entension to String to handle ISO 8601.
3841
extension String {
3942
/// Attempts to parse the string as an ISO 8601 date.
4043
var iso8601: Date? {

Sources/BreezeDynamoDBService/ListResponse.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Foundation
1919
#endif
2020

2121
/// Model representing a paginated list response from a DynamoDB operation.
22+
///
2223
/// This struct contains an array of items and an optional last evaluated key for pagination.
2324
/// This struct conforms to `CodableSendable`, allowing it to be encoded and decoded for network transmission or storage.
2425
public struct ListResponse<Item: CodableSendable>: CodableSendable {

0 commit comments

Comments
 (0)