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
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

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

61 changes: 61 additions & 0 deletions Package.resolved

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

34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "TrueTime",
products: [
.library(
name: "TrueTime",
targets: ["TrueTime"]),
.library(
name: "CTrueTime",
targets: ["CTrueTime"])
],
dependencies: [
.package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "8.0.1")),
.package(url: "https://github.com/Quick/Quick.git", .upToNextMajor(from: "2.1.0")),
.package(url: "https://github.com/typelift/SwiftCheck.git", .upToNextMajor(from: "0.12.0")),
],
targets: [
.target(
name: "TrueTime",
dependencies: ["CTrueTime"]),
.testTarget(
name: "TrueTimeTests",
dependencies: [
"TrueTime",
"Quick",
"Nimble",
"SwiftCheck"
]
),
.systemLibrary(name: "CTrueTime")
]
)
26 changes: 0 additions & 26 deletions Sources/TrueTime.h

This file was deleted.

12 changes: 0 additions & 12 deletions Sources/TrueTime.m

This file was deleted.

1 change: 1 addition & 0 deletions Sources/Endian.swift → Sources/TrueTime/Endian.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

protocol NetworkOrderConvertible {
var byteSwapped: Self { get }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions Sources/NTPClient.swift → Sources/TrueTime/NTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Instacart. All rights reserved.
//

import Foundation
import CTrueTime

struct NTPConfig {
let timeout: TimeInterval
let maxRetries: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

typealias NTPConnectionCallback = (NTPConnection, FrozenNetworkTimeResult) -> Void

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

public extension timeval {
static func uptime() -> timeval {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

struct NTPResponse {
let packet: ntp_packet_t
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Instacart. All rights reserved.
//

import Foundation
import CTrueTime

typealias FrozenTimeResult = Result<FrozenTime, NSError>
typealias FrozenTimeCallback = (FrozenTimeResult) -> Void

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions Sources/TrueTime.swift → Sources/TrueTime/TrueTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

import Foundation

let TrueTimeErrorDomain = "com.instacart.TrueTimeErrorDomain"

public extension Notification.Name {
static let TrueTimeUpdated = Notification.Name.init("TrueTimeUpdatedNotification")
}

@objc public enum TrueTimeError: Int {
case cannotFindHost
case dnsLookupFailed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

@testable import TrueTime
import CTrueTime
import SwiftCheck

extension timeval: Arbitrary {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

@testable import TrueTime
import CTrueTime
import Nimble
import Quick
import SwiftCheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

@testable import TrueTime
import Foundation
import Nimble
import Quick

Expand Down