Skip to content

Commit 8d45297

Browse files
KafkaFoundationCompat (#105)
Motivation: Users should be able to use `Data` as key/value of `KakfaProducerMessage`. Modifications: * add new `.library` `"KafkaFoundationCompat"` alongside a new target * make `Foundation.Data` conform to `KafkaContiguousBytes`
1 parent 3a85aff commit 8d45297

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Package.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ let package = Package(
3939
name: "SwiftKafka",
4040
targets: ["SwiftKafka"]
4141
),
42+
.library(
43+
name: "KafkaFoundationCompat",
44+
targets: ["KafkaFoundationCompat"]
45+
),
4246
],
4347
dependencies: [
4448
.package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"),
@@ -78,6 +82,12 @@ let package = Package(
7882
.product(name: "Logging", package: "swift-log"),
7983
]
8084
),
85+
.target(
86+
name: "KafkaFoundationCompat",
87+
dependencies: [
88+
"SwiftKafka",
89+
]
90+
),
8191
.systemLibrary(
8292
name: "COpenSSL",
8393
pkgConfig: "openssl",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-gsoc open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-gsoc project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-gsoc project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
import Foundation
16+
import SwiftKafka
17+
18+
extension Data: KafkaContiguousBytes {}

0 commit comments

Comments
 (0)