Skip to content

Commit b98f1a4

Browse files
README: howto include SwiftKafka in Package.swift (#74)
1 parent e519908 commit b98f1a4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
SwiftKafka is a Swift Package in development that provides a convenient way to communicate with [Apache Kafka](https://kafka.apache.org) servers. The main goal was to create an API that leverages [Swift's new concurrency features](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html). Under the hood, this package uses the [`librdkafka`](https://github.com/confluentinc/librdkafka) C library.
44

5+
## Adding SwiftKafka as a Dependency
6+
7+
To use the `SwiftKafka` library in a SwiftPM project,
8+
add the following line to the dependencies in your `Package.swift` file:
9+
10+
```swift
11+
.package(url: "https://github.com/swift-server/swift-kafka-gsoc", branch: "main")
12+
```
13+
14+
Include `"SwiftKafka"` as a dependency for your executable target:
15+
16+
```swift
17+
.target(name: "<target>", dependencies: [
18+
.product(name: "SwiftKafka", package: "swift-kafka-gsoc"),
19+
]),
20+
```
21+
22+
Finally, add `import SwiftKafka` to your source code.
23+
524
## Usage
625

726
### Producer API

0 commit comments

Comments
 (0)