swiftnioextras/swift-nio-irc
SwiftNIO-IRC is a Internet Relay Chat
Importing the module using Swift Package Manager
An example Package.swift importing the necessary modules:
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "IRCTests",
dependencies: [
.package(url: "https://github.com/SwiftNIOExtras/swift-nio-irc.git",
from: "0.6.0")
],
targets: [
.target(name: "MyProtocolTool",
dependencies: [ "NIOIRC" ])
]
)Using the SwiftNIO IRC protocol handler
The IRC protocol is implemented as a regular ChannelHandler, similar to NIOHTTP1. It takes incoming ByteBuffer data, parses that, and emits IRCMessage items. Same the other way around, the user writes IRCReply objects, and the handler renders such into ByteBuffers.
To add the IRC handler to a NIO Channel pipeline:
import NIOIRC
bootstrap.channelInitializer { channel in
channel.pipeline
.add(handler: IRCChannelHandler())
.then { ... }
}Who
Brought to you by ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.
Package Metadata
Repository: swiftnioextras/swift-nio-irc
Default branch: main
README: README.md