Skip to content

Commit

Permalink
Merge pull request #99 from gertrude-app/timespan
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 authored Oct 10, 2024
2 parents 451baff + ad6ae66 commit d505f00
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ extension LogSecurityEvent: Resolver {

guard let event = Gertie.SecurityEvent.MacApp(rawValue: input.event) else {
if input.event != "appUpdateInitiated" { // <-- removed for noise
await with(dependency: \.slack)
.sysLog(to: "errors", "Received unknown security event: `\(input.event)`")
await with(dependency: \.slack).sysLog(
to: "errors",
"Unknown security event: `\(input.event)`, detail: \(input.detail ?? "(nil)")"
)
}
return .success
}
Expand Down
27 changes: 27 additions & 0 deletions gertie/Sources/Gertie/Time.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// A wall-clock time not associated with a particular date or time zone
public struct PlainTime {
var hour: UInt8
var minute: UInt8

public init(hour: UInt8, minute: UInt8) {
self.hour = hour
self.minute = minute
}
}

/// A time "window" with a start and end not
/// associated with a particular date or time zone
public struct PlainTimeWindow {
var start: PlainTime
var end: PlainTime

public init(start: PlainTime, end: PlainTime) {
self.start = start
self.end = end
}
}

// extensions

extension PlainTime: Sendable, Equatable, Hashable, Codable {}
extension PlainTimeWindow: Sendable, Equatable, Hashable, Codable {}

0 comments on commit d505f00

Please sign in to comment.