common

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 0 Imported by: 0

README ¶

Common

🌱 Overview

The common package provides foundational shared utilities and reusable components used across the Entiqon project.
It enables consistency, code reuse, and reliable parsing/error handling.


🚀 Quick Start

go get github.com/entiqon/common

📦 Subpackages

Package Description
🧩 errors Sentinel errors (UnsupportedTypeError, InvalidIdentifierError) with GoDoc and examples.
🧩 extension/boolean Parsing helpers for booleans with extended tokens (on/off, y/n, t/f); BoolToString utility.
🧩 extension/date Deterministic parsing/cleaning (CleanAndParse, strict YYYYMMDD).
🧩 extension/decimal Decimal parsers with safe fallback (Or) and rounding.
🧩 extension/float Float parsers with fallback (Or) support.
🧩 extension/number General number parsing with fallback and normalization.
🧩 extension/integer ParseFrom(any), IntegerOr, consistent with other numeric parsers.
🧩 extension/collection Helpers for slices and maps.
🧩 extension/object Generic object utilities (Exists, GetValue, SetValue).

📄 License

MIT — © Entiqon Project

Documentation ¶

Overview ¶

Package common provides foundational building blocks shared across Entiqon.

It contains reusable utilities, error handling extensions, reflection helpers, and strongly typed parsers for primitive and structured values.

Subpackages include:

  • errors: structured error types (CausableError, ProcessStageError).
  • extension: strongly typed value parsers and helpers, such as:
  • boolean → flexible boolean parsing (true/false, yes/no, on/off…)
  • date → date parsing and normalization
  • decimal → decimal parsing with precision control
  • float → floating-point parsing
  • number → integer parsing and rounding
  • object → reflection helpers (Exists, GetValue, SetValue)
  • collection → generic typed collections with rich helper methods

The common module enables consistency and code reuse across Entiqon’s ecosystem.

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

This section is empty.

Types ¶

type ProcessStage ¶

type ProcessStage string

ProcessStage identifies a named stage or step in a multi-stage process.

It is a string alias type used to represent the various phases or checkpoints in a workflow or processing pipeline where errors or specific events may occur.

This type is designed to be flexible and extensible; developers can define additional custom stages by declaring new constants of this type as needed.

Example:

const (
    StageInit     ProcessStage = "Init"
    StageParse    ProcessStage = "Parse"
    StageValidate ProcessStage = "Validate"
    StageExecute  ProcessStage = "Execute"
    StageFinalize ProcessStage = "Finalize"
)

Custom stages can be added in user code:

const StageCustom ProcessStage = "CustomStage"
const (
	// StageInit represents the initialization stage.
	StageInit ProcessStage = "Init"

	// StageParse represents the parsing stage.
	StageParse ProcessStage = "Parse"

	// StageValidate represents the validation stage.
	StageValidate ProcessStage = "Validate"

	// StageExecute represents the execution stage.
	StageExecute ProcessStage = "Execute"

	// StageFinalize represents the finalization stage.
	StageFinalize ProcessStage = "Finalize"
)

Predefined common stages in the processing lifecycle.

Directories ¶

Path Synopsis
Package errors provides extended error handling utilities for Entiqon.
Package errors provides extended error handling utilities for Entiqon.
Package extension provides strongly typed parsers and helpers for primitive and structured values.
Package extension provides strongly typed parsers and helpers for primitive and structured values.
boolean
Package boolean provides utilities for parsing and formatting boolean values.
Package boolean provides utilities for parsing and formatting boolean values.
collection
Package collection provides a generic, type-safe container for values.
Package collection provides a generic, type-safe container for values.
date
Package date provides utilities to parse and format time.Time values.
Package date provides utilities to parse and format time.Time values.
decimal
Package decimal provides utilities to parse values into float64 with optional rounding.
Package decimal provides utilities to parse values into float64 with optional rounding.
float
Package float provides utilities to parse values into float64.
Package float provides utilities to parse values into float64.
integer
Package integer provides parsing utilities to convert values into int.
Package integer provides parsing utilities to convert values into int.
number
Package number provides utilities for parsing numeric values into int with optional rounding.
Package number provides utilities for parsing numeric values into int with optional rounding.
object
Package object provides utilities for dynamic access and manipulation of heterogeneous objects using reflection.
Package object provides utilities for dynamic access and manipulation of heterogeneous objects using reflection.

Jump to

Keyboard shortcuts

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