frantic-core

module
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: Apache-2.0

README

frantic-core

frantic-core is a Go utility library and application toolkit.

It includes a large set of helper packages for banking, dates, logging, configuration, financial calculations, and more.

Package Documentation

Package Description
application OS/platform detection and system identity
banking IBAN, ISIN, LEI, UTI validation and GLEIF API lookup
chiMiddleware Chi router middleware (Brotli, minify, method conversion, context injection)
colours ANSI colour escape sequences for terminal styling
commonConfig TOML-based application configuration
commonErrors Shared sentinel errors and wrapping helpers
contextHandler Request-scoped context and session management
dateHelpers Date formatting, parsing, arithmetic, and business-day logic
dockerHelpers Docker environment detection and payload deployment
emailHandler Email composition and SMTP sending
financial Tenor calculations, settlement dates, and amount formatting
frantic Project identity utilities and validation
htmlHelpers HTML value conversion and URL-safe encoding
idHelpers ID generation (KSUID), hashing, and composite IDs
ioHelpers File I/O, copy, backup, and directory management
logHandler Multi-channel logging with file rotation
mathHelpers Random numbers, min/max, coin toss
messageHelpers Inter-service message types (user, session, authority, translation)
mockData Mock reference datasets for testing (countries, currencies, etc.)
netHandler Network host reachability checking
notificationHandler Push notifications via Pushover
paths Filesystem path helpers and directory structure
stringHelpers String formatting, quoting, encoding, and manipulation
timeHelpers Timezone inference from locale
timing Stopwatch timing and snooze utilities
tuiInputHelper Terminal UI input prompts

Features

  • Banking utilities (IBAN, ISIN, LEI, UTI validation and formatting)
  • GLEIF API integration for LEI lookups
  • Color terminal output
  • Centralized TOML-based configuration management
  • Common error handling with sentinel errors and wrappers
  • Context and session helpers with worker pool support
  • Date and time utilities with business-day awareness
  • Docker environment detection
  • Email sending via SMTP
  • Financial calculations (tenors, settlement dates, rate ladders, amount formatting)
  • Project identity validation
  • HTML value helpers and URL-safe encoding
  • ID generation (KSUID), hashing (SHA3-256), and composite IDs
  • File I/O, backup, and directory management
  • Multi-channel logging with file rotation (lumberjack)
  • Math helpers (random, min/max)
  • Inter-service messaging types
  • Mock reference data (countries, currencies, genders, titles, rate ladders)
  • Network host reachability checks
  • Push notifications (Pushover)
  • Filesystem path management
  • String manipulation and formatting
  • Timezone inference
  • Stopwatch timing and sleep utilities
  • Terminal UI input helpers
  • Chi router middleware (Brotli, HTML minification, HTTP method conversion)

Directory Structure

application/         # OS/platform detection and system identity
banking/             # Financial identifier validation (IBAN, ISIN, LEI, UTI)
chiMiddleware/       # Chi router middleware
colours/             # ANSI colour escape sequences
commonConfig/        # TOML-based configuration management
commonErrors/        # Shared sentinel errors and wrappers
contextHandler/      # Context and session management
dateHelpers/         # Date utilities and business-day logic
dockerHelpers/       # Docker environment support
emailHandler/        # Email sending via SMTP
financial/           # Financial calculations and tenor logic
frantic/             # Project identity utilities
htmlHelpers/         # HTML value helpers and URL encoding
idHelpers/           # ID generation and hashing
ioHelpers/           # File I/O and directory management
logHandler/          # Multi-channel logging with rotation
mathHelpers/         # Numeric helpers
messageHelpers/      # Inter-service message types
mockData/            # Mock reference datasets
netHandler/          # Network reachability checking
notificationHandler/ # Push notifications (Pushover)
paths/               # Filesystem path helpers
stringHelpers/       # String manipulation
timeHelpers/         # Timezone inference
timing/              # Stopwatch and snooze utilities
tuiInputHelper/      # Terminal UI input helpers

Installation

To use frantic-core in your Go project:

go get github.com/mt1976/frantic-core

Usage

Import the package or specific modules as needed:

import (
    "github.com/mt1976/frantic-core/banking"
    "github.com/mt1976/frantic-core/dateHelpers"
    "github.com/mt1976/frantic-core/logHandler"
    // ...other imports as needed
)
Example: Validate an IBAN
package main

import (
    "fmt"
    "github.com/mt1976/frantic-core/banking"
)

func main() {
    iban, err := banking.NewIBAN("GB82WEST12345698765432")
    if err != nil {
        fmt.Println("Invalid IBAN:", err)
        return
    }
    fmt.Println("IBAN:", iban.String())
}
Example: Logging
import "github.com/mt1976/frantic-core/logHandler"

func main() {
    logHandler.Info.Println("Application started")
}
Example: Date Helper
import (
    "fmt"
    "github.com/mt1976/frantic-core/dateHelpers"
)

func main() {
    today := dateHelpers.Today()
    fmt.Println("Today:", dateHelpers.FormatHuman(today))
    fmt.Println("Is working day:", dateHelpers.IsWorkingDay(today))
}

License

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

Directories

Path Synopsis
Package application contains OS and environment utilities such as host/platform detection and basic system identity helpers.
Package application contains OS and environment utilities such as host/platform detection and basic system identity helpers.
Package banking provides helpers for financial identifiers and standards such as IBAN, ISIN, LEI, and UTI parsing and validation.
Package banking provides helpers for financial identifiers and standards such as IBAN, ISIN, LEI, and UTI parsing and validation.
Package colours exposes ANSI color escape sequences for simple terminal styling.
Package colours exposes ANSI color escape sequences for simple terminal styling.
Package commonConfig defines application configuration structures and accessors for dates, logging, servers, databases, assets, and security.
Package commonConfig defines application configuration structures and accessors for dates, logging, servers, databases, assets, and security.
Package commonErrors declares shared error variables and wrapping helpers to produce consistent, contextual error messages across the project.
Package commonErrors declares shared error variables and wrapping helpers to produce consistent, contextual error messages across the project.
Package contextHandler manages request-scoped context, including getting and setting values on application contexts.
Package contextHandler manages request-scoped context, including getting and setting values on application contexts.
Package dateHelpers provides utilities for date/time formatting, parsing, arithmetic, and business-day adjustments used across the project.
Package dateHelpers provides utilities for date/time formatting, parsing, arithmetic, and business-day adjustments used across the project.
Package dockerHelpers provides helpers to detect Docker environments and interact with container-related metadata.
Package dockerHelpers provides helpers to detect Docker environments and interact with container-related metadata.
Package emailHandler manages email composition and sending utilities.
Package emailHandler manages email composition and sending utilities.
Package financial provides date/tenor calculations and financial helpers used for scheduling and time conventions.
Package financial provides date/tenor calculations and financial helpers used for scheduling and time conventions.
Package frantic defines identity utilities and validation for official project/component names within the frantic ecosystem.
Package frantic defines identity utilities and validation for official project/component names within the frantic ecosystem.
Package htmlHelpers provides small helpers for generating and working with HTML fragments.
Package htmlHelpers provides small helpers for generating and working with HTML fragments.
Package idHelpers provides helpers for generating and formatting IDs.
Package idHelpers provides helpers for generating and formatting IDs.
Package ioHelpers provides simple I/O utilities for files and streams.
Package ioHelpers provides simple I/O utilities for files and streams.
Package logHandler centralizes application logging facilities and helpers.
Package logHandler centralizes application logging facilities and helpers.
Package mathHelpers contains small numeric helpers and utility functions.
Package mathHelpers contains small numeric helpers and utility functions.
Package messageHelpers defines shared message types used between services and application components.
Package messageHelpers defines shared message types used between services and application components.
Package mockData provides deterministic mock datasets for tests and examples.
Package mockData provides deterministic mock datasets for tests and examples.
Package netHandler provides HTTP/network helpers for client and server code.
Package netHandler provides HTTP/network helpers for client and server code.
Package notificationHandler exposes notification utilities for system and user alerts.
Package notificationHandler exposes notification utilities for system and user alerts.
Package paths centralizes filesystem path helpers and constants.
Package paths centralizes filesystem path helpers and constants.
Package stringHelpers provides common string utilities for formatting and validation.
Package stringHelpers provides common string utilities for formatting and validation.
Package timehelpers contains helpers for time-of-day and duration handling.
Package timehelpers contains helpers for time-of-day and duration handling.
Package timing provides simple timing utilities and instrumentation helpers.
Package timing provides simple timing utilities and instrumentation helpers.
Package tuiInputHelper offers helpers for terminal UI input handling.
Package tuiInputHelper offers helpers for terminal UI input handling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL