Skip to content

Commit fb8c749

Browse files
committed
Add Flight
1 parent 5a283ce commit fb8c749

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

Sources/SparkConnect/FlightDescriptor.swift

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,39 @@
1818
import Foundation
1919

2020
public class FlightDescriptor {
21-
public enum DescriptorType {
22-
case unknown
23-
case path
24-
case cmd
25-
}
21+
public enum DescriptorType {
22+
case unknown
23+
case path
24+
case cmd
25+
}
2626

27-
public let type: FlightDescriptor.DescriptorType
28-
public let cmd: Data
29-
public let paths: [String]
27+
public let type: FlightDescriptor.DescriptorType
28+
public let cmd: Data
29+
public let paths: [String]
3030

31-
init(_ descriptor: Arrow_Flight_Protocol_FlightDescriptor) {
32-
self.type = descriptor.type == .cmd ? .cmd : .path
33-
self.cmd = descriptor.cmd
34-
self.paths = descriptor.path
35-
}
31+
init(_ descriptor: Arrow_Flight_Protocol_FlightDescriptor) {
32+
self.type = descriptor.type == .cmd ? .cmd : .path
33+
self.cmd = descriptor.cmd
34+
self.paths = descriptor.path
35+
}
3636

37-
public init(cmd: Data) {
38-
self.type = .cmd
39-
self.cmd = cmd
40-
self.paths = [String]()
41-
}
37+
public init(cmd: Data) {
38+
self.type = .cmd
39+
self.cmd = cmd
40+
self.paths = [String]()
41+
}
4242

43-
public init(paths: [String]) {
44-
self.type = .path
45-
self.cmd = Data()
46-
self.paths = paths
47-
}
43+
public init(paths: [String]) {
44+
self.type = .path
45+
self.cmd = Data()
46+
self.paths = paths
47+
}
4848

49-
func toProtocol() -> Arrow_Flight_Protocol_FlightDescriptor {
50-
var descriptor = Arrow_Flight_Protocol_FlightDescriptor()
51-
descriptor.type = self.type == .cmd ? .cmd : .path
52-
descriptor.cmd = self.cmd
53-
descriptor.path = self.paths
54-
return descriptor
55-
}
49+
func toProtocol() -> Arrow_Flight_Protocol_FlightDescriptor {
50+
var descriptor = Arrow_Flight_Protocol_FlightDescriptor()
51+
descriptor.type = self.type == .cmd ? .cmd : .path
52+
descriptor.cmd = self.cmd
53+
descriptor.path = self.paths
54+
return descriptor
55+
}
5656
}

0 commit comments

Comments
 (0)