AbyssIrc.Core 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AbyssIrc.Core --version 0.2.0
                    
NuGet\Install-Package AbyssIrc.Core -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AbyssIrc.Core" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AbyssIrc.Core" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="AbyssIrc.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AbyssIrc.Core --version 0.2.0
                    
#r "nuget: AbyssIrc.Core, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=AbyssIrc.Core&version=0.2.0
                    
Install AbyssIrc.Core as a Cake Addin
#tool nuget:?package=AbyssIrc.Core&version=0.2.0
                    
Install AbyssIrc.Core as a Cake Tool

AbyssIrc.Core

NuGet License: MIT

Core library for AbyssIrc server, providing the foundation for building modular, extensible IRC server components.

Overview

AbyssIrc.Core is the fundamental building block of the AbyssIrc server ecosystem. It provides essential utilities, interfaces, extensions, and data structures that other AbyssIrc modules rely on. This library is designed to be lightweight yet powerful, offering a consistent set of tools for IRC server development.

Features

  • Configuration System: YAML-based configuration with strong typing and validation
  • Directory Management: Structured directory system for server resources
  • Template Engine: Dynamic text templating using Scriban for MOTD and messages
  • Event System: Base interfaces for the event/signal system
  • Common Utilities: String processing, JSON serialization, YAML parsing
  • Extension Methods: Comprehensive set of extension methods for common operations
  • Service Interface Definitions: Core service interfaces for IRC server operations

Installation

Via NuGet

# Install via .NET CLI
dotnet add package AbyssIrc.Core

# Install via Package Manager
Install-Package AbyssIrc.Core

Via PackageReference in .csproj

<ItemGroup>
    <PackageReference Include="AbyssIrc.Core" Version="0.1.0" />
</ItemGroup>

Usage Examples

Configuration

// Load a YAML configuration
var configYaml = File.ReadAllText("config.yml");
var config = configYaml.FromYaml<AbyssIrcConfig>();

// Save configuration
var yaml = config.ToYaml();
File.WriteAllText("config.yml", yaml);

Directory Management

// Create a structured directory system
var dirConfig = new DirectoriesConfig("/path/to/root");

// Access specific directories
string databaseDir = dirConfig[DirectoryType.Database];
string scriptsDir = dirConfig[DirectoryType.Scripts];
string logsDir = dirConfig[DirectoryType.Logs];

Template Variables

// Create a text template service
var templateService = new TextTemplateService(logger, signalService);

// Add static variables
templateService.AddVariable("hostname", "irc.example.com");
templateService.AddVariable("version", "1.0.0");

// Add dynamic variables with builders
templateService.AddVariableBuilder("uptime", () =>
    (DateTime.Now - Process.GetCurrentProcess().StartTime).ToString());

// Process a template
string motd = "Welcome to {{hostname}} running version {{version}}!\nServer uptime: {{uptime}}";
string processed = templateService.TranslateText(motd);

Utility Methods

// String utilities
string snakeCase = "MyClassName".ToSnakeCase(); // "my_class_name"
string camelCase = "SERVER_NAME".ToCamelCase(); // "serverName"

// Hash utilities
string md5Hash = "test string".GetMd5Checksum();

// Base64 utilities
bool isBase64 = "SGVsbG8gV29ybGQ=".IsBase64String(); // true
string encoded = "Hello World".ToBase64(); // "SGVsbG8gV29ybGQ="

// Environment variable replacement
string withEnv = "User: {USER}".ReplaceEnvVariable(); // "User: john"

// Date/time utilities
long timestamp = DateTime.Now.ToUnixTimestamp();
DateTime fromTimestamp = 1609459200L.FromEpoch();

Core Components

Configuration Classes

  • AbyssIrcConfig: Main server configuration
  • NetworkConfig: Network-related settings
  • AdminConfig: Administrator settings
  • LimitConfig: Server limits and constraints
  • MotdConfig: Message of the day settings

Interfaces

  • IAbyssStarStopService: Interface for services that can be started and stopped
  • Various event-related interfaces that form the base of the signaling system

Directory Organization

Structured directory types for server resources:

  • Root: Main server directory
  • Database: Data storage
  • Scripts: JavaScript scripts
  • Cache: Temporary files
  • Certs: SSL/TLS certificates
  • Messages: Templates and message files
  • Logs: Server logs

Dependency on Other AbyssIrc Packages

AbyssIrc.Core is designed to have minimal external dependencies and serves as a foundation for other AbyssIrc packages:

  • AbyssIrc.Network: Builds on Core to provide IRC protocol implementation
  • AbyssIrc.Signals: Uses Core interfaces to implement the event system
  • AbyssIrc.Server: Combines all modules to create the complete IRC server

Requirements

  • .NET 9.0 or later
  • Compatible with Windows, Linux, and macOS

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! If you're interested in improving AbyssIrc.Core:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

For more information on AbyssIrc and related projects, visit the AbyssIrc GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AbyssIrc.Core:

Package Downloads
AbyssIrc.Server.Core

Core server components for AbyssIrc. Provides the fundamental server framework, interfaces, and implementations for building IRC server functionality.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.4 171 4/14/2025
0.2.3 143 4/7/2025
0.2.2 73 4/5/2025
0.2.1 100 4/4/2025
0.2.0 105 4/4/2025
0.1.15 143 4/3/2025
0.1.14 153 4/3/2025
0.1.9 140 4/3/2025
0.1.8 148 4/3/2025
0.1.7 149 4/2/2025
0.1.6 136 4/2/2025