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
6 changes: 6 additions & 0 deletions Sources/YData/Core/Context/EventLoopContext.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation
import protocol NIO.EventLoop

public protocol EventLoopContext {
var eventLoop: EventLoop { get }
}
6 changes: 6 additions & 0 deletions Sources/YData/Core/Context/LoggerContext.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation
import Vapor

public protocol LoggerContext {
var logger: Logger { get }
}
5 changes: 1 addition & 4 deletions Sources/YData/Core/Service.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import Foundation
import Vapor

public protocol ServiceContext {
var eventLoop: EventLoop { get }
var logger: Logger { get }
}
public protocol ServiceContext: EventLoopContext, LoggerContext {}

public protocol Service {
associatedtype Context: ServiceContext
Expand Down
6 changes: 6 additions & 0 deletions Sources/YData/Database/DatabaseContext.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Fluent
import Foundation

public protocol DatabaseContext {
var database: Database { get }
}
5 changes: 1 addition & 4 deletions Sources/YData/Database/DatabaseServiceContext.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Fluent
import Foundation

public protocol DatabaseServiceContext: ServiceContext {
var database: Database { get }
}
public protocol DatabaseServiceContext: DatabaseContext, ServiceContext {}