Swiftpack.co - SwiftNIOExtras/swift-nio-irc as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
SwiftNIOExtras/swift-nio-irc
A Internet Relay Chat (IRC) protocol implementation for SwiftNIO
.package(url: "https://github.com/SwiftNIOExtras/swift-nio-irc.git", from: "0.8.2")

SwiftNIO IRC

Swift5 iOS macOS tuxOS

SwiftNIO-IRC is a Internet Relay Chat protocol implementation for SwiftNIO.

This module contains just the protocol implementation. We also provide:

To get started with this, pull swift-nio-irc-server - a module to rule them all and in the darkness bind them.

NIOIRC is a SwiftNIO port of the Noze.io miniirc example from 2016.

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.

GitHub

link
Stars: 33
Last commit: 28 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Dependencies

Release Notes

L00per
2 years ago

Fix an endless loop in the IRC message parser, should fix issue #4.

The parser skips empty lines, but didn't properly adjust the looping index. That should be fixed now.

P.S.: Now building on more Travis platforms (e.g. Linux Swift 4.2, and XcodeX)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics