Skip to content
Merged
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
7 changes: 0 additions & 7 deletions Package.pins

This file was deleted.

79 changes: 79 additions & 0 deletions Package.resolved

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

19 changes: 12 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// swift-tools-version:3.1
// swift-tools-version:4.0

import PackageDescription

let package = Package(
name: "DynamodbSessionStore",
targets: [
Target(name: "DynamodbSessionStore"),
Target(name: "DynamodbSessionStoreTableManager"),
Target(name: "DynamodbSessionStoreExample", dependencies: ["DynamodbSessionStore"])
products: [
.library(name: "DynamodbSessionStore", targets: ["DynamodbSessionStore"]),
.executable(name: "dynamodb-session-store-table-manager", targets: ["DynamodbSessionStoreTableManager"]),
.executable(name: "dynamodb-session-store-example", targets: ["DynamodbSessionStoreExample"]),
],
dependencies: [
.Package(url: "https://github.com/swift-aws/dynamodb.git", majorVersion: 0, minor: 1),
.Package(url: "https://github.com/noppoMan/HexavilleFramework.git", majorVersion: 0, minor: 1)
.package(url: "https://github.com/swift-aws/dynamodb.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/noppoMan/HexavilleFramework.git", .upToNextMajor(from: "0.1.15"))
],
targets: [
.target(name: "DynamodbSessionStore", dependencies: ["SwiftAWSDynamodb", "HexavilleFramework"]),
.target(name: "DynamodbSessionStoreTableManager", dependencies: ["DynamodbSessionStore"]),
.target(name: "DynamodbSessionStoreExample", dependencies: ["DynamodbSessionStore"])
]
)
2 changes: 1 addition & 1 deletion Sources/DynamodbSessionStoreExample/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ app.use { req, context in
return .next(req)
}

let router = Router()
var router = Router()

router.use(.get, "/") { req, context in
if let now = context.session?["now"] {
Expand Down
14 changes: 7 additions & 7 deletions Sources/DynamodbSessionStoreTableManager/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class CreateCommand: Command {

let name = "create"
let tableName = Parameter()
let writeCapacityUnits = Key<Int>("--writeCapacityUnits", usage: "numnber of WriteCapacityUnits")
let readCapacityUnits = Key<Int>("--readCapacityUnits", usage: "numnber of ReadCapacityUnits")
let endpoint = Key<String>("--endpoint", usage: "The endpoint string. ex: http://localhost:8000")
let writeCapacityUnits = Key<Int>("--writeCapacityUnits", description: "numnber of WriteCapacityUnits")
let readCapacityUnits = Key<Int>("--readCapacityUnits", description: "numnber of ReadCapacityUnits")
let endpoint = Key<String>("--endpoint", description: "The endpoint string. ex: http://localhost:8000")

func execute() throws {
let dynamodb = Dynamodb(endpoint: endpoint.value)
Expand Down Expand Up @@ -94,7 +94,7 @@ class CreateCommand: Command {
class DeleteCommand: Command {
let name = "delete"
let tableName = Parameter()
let endpoint = Key<String>("--endpoint", usage: "The endpoint string. ex: http://localhost:8000")
let endpoint = Key<String>("--endpoint", description: "The endpoint string. ex: http://localhost:8000")

func execute() throws {
do {
Expand All @@ -107,6 +107,6 @@ class DeleteCommand: Command {
}
}

CLI.setup(name: "hexaville-dynamodb-session-store-table-manager")
CLI.register(commands: [CreateCommand(), DeleteCommand()])
_ = CLI.go()
let ddbSesTableManagerCLI = CLI(name: "hexaville-dynamodb-session-store-table-manager")
ddbSesTableManagerCLI.commands = [CreateCommand(), DeleteCommand()]
_ = ddbSesTableManagerCLI.go()