Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
.package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.0.0"),
.package(url: "https://github.com/tachyonics/smockable", from: "1.0.0-rc.3"),
.package(url: "https://github.com/apple/swift-configuration", from: "1.1.0"),
.package(url: "https://github.com/tachyonics/swift-wire", branch: "main"),
],
targets: [
.target(
Expand Down Expand Up @@ -55,7 +56,9 @@ let package = Package(
.product(name: "DynamoDBTables", package: "dynamo-db-tables"),
.product(name: "Configuration", package: "swift-configuration"),
.product(name: "Hummingbird", package: "hummingbird"),
]
.product(name: "Wire", package: "swift-wire"),
],
plugins: [.plugin(name: "WireBuildPlugin", package: "swift-wire")]
),
.testTarget(
name: "TaskClusterTests",
Expand Down
11 changes: 11 additions & 0 deletions Sources/TaskCluster/ApplicationWiring.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import DynamoDBTables
import Logging
import Wire

enum ApplicationWiring {
@Provides
static let logger = Logger(label: "TaskCluster")

@Provides
static let table = InMemoryDynamoDBCompositePrimaryKeyTable()
}
9 changes: 3 additions & 6 deletions Sources/TaskCluster/TaskCluster.swift
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import Configuration
import DynamoDBTables
import Hummingbird
import Logging
import TaskClusterApp
import TaskClusterDynamoDBModel

@main
struct TaskCluster {
static func main() async throws {
let graph = try await _WireGraph.bootstrap()
let config = ConfigReader(provider: EnvironmentVariablesProvider())
let port = config.int(forKey: "HTTP_PORT", default: 8080)

let logger = Logger(label: "TaskCluster")
let table = InMemoryDynamoDBCompositePrimaryKeyTable()
let repository = DynamoDBTaskRepository(table: table)
let repository = DynamoDBTaskRepository(table: graph.inMemoryDynamoDBCompositePrimaryKeyTable)
let configuration = ApplicationConfiguration(
address: .hostname("0.0.0.0", port: port)
)

let application = try buildApplication(
repository: repository,
configuration: configuration,
logger: logger
logger: graph.logger
)
try await application.run()
}
Expand Down
Loading