diff --git a/Sources/GitHubKit/GitHub.swift b/Sources/GitHubKit/GitHub.swift index ade26a5..aa85173 100644 --- a/Sources/GitHubKit/GitHub.swift +++ b/Sources/GitHubKit/GitHub.swift @@ -156,6 +156,11 @@ extension GitHub { return self.eventLoop.makeSucceededFuture(Void()) } } + + /// Delete a file + public func delete(path: String, post: E) throws -> EventLoopFuture where C: Decodable, E: Encodable { + return try send(method: .DELETE, path: path, post: post) + } /// Retrieve a file public func get(file path: String) throws -> EventLoopFuture { diff --git a/Sources/GitHubKit/GitHubClient.swift b/Sources/GitHubKit/GitHubClient.swift index c80ef92..47e0266 100644 --- a/Sources/GitHubKit/GitHubClient.swift +++ b/Sources/GitHubKit/GitHubClient.swift @@ -10,6 +10,7 @@ public protocol GitHubClient { func put(path: String, post: E) throws -> EventLoopFuture where C: Decodable, E: Encodable func patch(path: String, post: E) throws -> EventLoopFuture where C: Decodable, E: Encodable func delete(path: String) throws -> EventLoopFuture + func delete(path: String, post: E) throws -> EventLoopFuture where C: Decodable, E: Encodable func get(file path: String) throws -> EventLoopFuture func redirect(file path: String, status: HTTPResponseStatus) throws -> EventLoopFuture func download(org: String, repo: String, ref: String, format: GitHub.Format) throws -> EventLoopFuture