|
1 | | -# SwiftNIO IRC |
| 1 | +# SwiftNIO IRC Client |
2 | 2 |
|
3 | 3 |  |
4 | 4 |  |
5 | 5 |  |
6 | 6 |  |
7 | | - |
| 7 | + |
8 | 8 |
|
9 | 9 | SwiftNIO-IRC is a Internet Relay Chat |
10 | 10 | [protocol implementation](Sources/NIOIRC) for |
11 | 11 | [SwiftNIO](https://github.com/apple/swift-nio) |
12 | 12 | and a simple |
13 | 13 | [IRC client](Sources/IRC). |
14 | 14 |
|
15 | | -This module contains the protocol implementation and the client, we also |
| 15 | +This module contains a simple IRC client library. We also |
16 | 16 | provide: |
| 17 | +- [swift-nio-irc](https://github.com/SwiftNIOExtras/swift-nio-irc) - |
| 18 | + the raw Swift NIO IRC protocol implementation |
17 | 19 | - [swift-nio-irc-webclient](https://github.com/NozeIO/swift-nio-irc-webclient) - |
18 | 20 | a simple IRC webclient + WebSocket gateway based on this module, |
19 | 21 | - [swift-nio-irc-eliza](https://github.com/NozeIO/swift-nio-irc-eliza) - |
@@ -42,41 +44,17 @@ import PackageDescription |
42 | 44 | let package = Package( |
43 | 45 | name: "IRCTests", |
44 | 46 | dependencies: [ |
45 | | - .package(url: "https://github.com/NozeIO/swift-nio-irc.git", |
46 | | - from: "0.5.0") |
| 47 | + .package(url: "https://github.com/NozeIO/swift-nio-irc-client.git", |
| 48 | + from: "0.6.0") |
47 | 49 | ], |
48 | 50 | targets: [ |
49 | | - .target(name: "MyProtocolTool", |
50 | | - dependencies: [ "NIOIRC" ]), |
51 | 51 | .target(name: "MyIRCClient", |
52 | 52 | dependencies: [ "IRC" ]) |
53 | 53 | ] |
54 | 54 | ) |
55 | 55 | ``` |
56 | 56 |
|
57 | 57 |
|
58 | | -## Using the SwiftNIO IRC protocol handler |
59 | | - |
60 | | -The IRC protocol is implemented as a regular |
61 | | -`ChannelHandler`, similar to `NIOHTTP1`. |
62 | | -It takes incoming `ByteBuffer` data, parses that, and emits `IRCMessage` |
63 | | -items. |
64 | | -Same the other way around, the user writes `IRCReply` |
65 | | -objects, and the handler renders such into `ByteBuffer`s. |
66 | | - |
67 | | -To add the IRC handler to a NIO Channel pipeline: |
68 | | - |
69 | | -```swift |
70 | | -import NIOIRC |
71 | | - |
72 | | -bootstrap.channelInitializer { channel in |
73 | | - channel.pipeline |
74 | | - .add(handler: IRCChannelHandler()) |
75 | | - .then { ... } |
76 | | -} |
77 | | -``` |
78 | | - |
79 | | - |
80 | 58 | ### Who |
81 | 59 |
|
82 | 60 | Brought to you by |
|
0 commit comments