farseer-go/fs
61.2
Adequate · 21 September 2026
6.5k
lines of production code
Go
primary language
4
measurements over time
What this system is
Farseer is a Go framework providing a modular infrastructure for building distributed applications. It offers a comprehensive set of utilities including an IoC container, structured logging, high-performance reflection, and distributed tracing. The system also manages asynchronous execution, configuration, and standardized API responses to streamline development.
How it got here
2022 — Farseer.Go framework initial release
14 changes.
This period marks the initial release of the Farseer.Go framework, establishing its core architecture and foundational components. The work focused on implementing a modular initialization lifecycle, an IoC container, structured logging, and various utility packages for configuration, exception handling, and type conversion.
2023–2026 — infrastructure and performance enhancements
13 changes.
This period focused on introducing core infrastructure components, including a distributed ID generator, async concurrency primitives, and a timing wheel for scheduled tasks. Significant effort was also directed toward observability and performance optimization, featuring a comprehensive tracing package, high-performance reflection utilities, and a batch file writer with MessagePack support.
Features
Add asyncLocal context management and thread-local storage
Introduced a new \asyncLocal\ package providing thread-local storage and a shared context mechanism for multi-layer applications. The \context.go\ file adds functions (\InitContext\, \GetContext\, \GetOrSetContext\, \SetContext\, \SetContextIfNotExists\, \Remove\) to store and retrieve data within a request's execution scope, utilizing \sync.Map\ and mutexes for thread safety. The \newAsyncLocal.go\ file implements a generic \New\[T\]\ function that creates \routine.ThreadLocal\ instances and registers them for automatic cleanup via a \Release\ function, which iterates through registered removal functions to clear memory.
asyncLocal · high confidence
Add enum for call types in tracing
Introduces a new \eumCallType\ package containing an \Enum\ type and constants for various call types (Http, Grpc, Database, Redis, Mq, Elasticsearch, Etcd, Hand, EventPublish) with a \ToString()\ method.
trace/eumCallType · high confidence
Add high-performance batch file writer with MessagePack support
Introduced a new \batchFileWriter\ component that provides a high-performance, asynchronous batch file writer. It supports configurable file rolling based on time intervals and file size limits, along with a file count limit. The writer now supports multiple serialization formats, including the newly added MessagePack serialization (via \msgpack/v5\), in addition to the default JSON serialization. This allows users to choose a more compact binary format for log data.
batchFileWriter · high confidence
Add structured log level enum with JSON and MsgPack serialization
Introduces a new \eumLogLevel\ package that defines a \LogLevel\ enum with values for Trace, Debug, Information, Warning, Error, and Critical. The enum supports string-to-enum conversion and provides custom JSON serialization via \MarshalJSON\/\UnmarshalJSON\ to output human-readable string labels. It also implements MsgPack serialization via \MarshalMsgpack\/\UnmarshalMsgpack\ for efficient binary encoding of log levels.
core/eumLogLevel · high confidence
Added color formatting utilities for log and text output
A new color package was introduced to provide ANSI escape code formatting for console output. It includes a predefined set of color brushes for log levels (Trace, Debug, Informational, Warning, Error, Critical, NoneLevel, Alert) and specific utility functions (Red, Yellow, Green, Blue) that wrap text in corresponding colored output. Helper functions (ReplaceRed, ReplaceYellow, etc.) are also provided to replace specific substrings with their colored equivalents in a given string.
color · high confidence
Added default timing wheel for scheduled tasks
A new timing wheel implementation has been introduced, providing a global default scheduler for managing timed tasks. This includes a default instance that can be initialized and started, along with methods to add scheduled tasks with various precision levels. The implementation supports multi-level time wheels for efficient time-based scheduling.
timingWheel · high confidence
Added high-performance reflection package for optimized object mapping
A new \fastReflect\ package was introduced to improve mapper component performance, reducing processing time for complex object records by approximately 100ms. The implementation includes custom low-level type definitions (\rtype\, \EmptyInterface\) and optimized value setting logic (\setValue.go\) that bypasses standard \reflect\ overhead. Caching mechanisms using \sync.Map\ are utilized to store type metadata (\TypeMeta\), significantly accelerating repeated reflection operations.
fastReflect · medium confidence
Added sonyflake distributed ID generator
Introduced a new sonyflake package that provides a distributed unique ID generator. The implementation generates 18-digit IDs composed of time, sequence, and machine ID components. A key behavioral feature is the machine ID generation logic, which attempts to use the lower 16 bits of a private IPv4 address, with a fallback to the public IPv4 address if no private address is found. The package includes both the core implementation and corresponding unit tests verifying the IP address selection logic.
sonyflake · high confidence
Complete flog package rewrite with multi-provider architecture
The flog package has been completely rewritten to support a multi-provider logging architecture, allowing logs to be written to the console, to files, and to a remote FOPS center simultaneously. The new implementation introduces a \CompositionLogger\ that dispatches log entries to all configured providers (Console, File, Fops) based on configurable log levels and formats (JSON or Text). Users can now configure log destinations, file rolling intervals, and output formats via the \Log\ configuration section. The \flog\ package now exposes a unified \ILog\ interface and a \DefaultLoggerFactory\ to manage these providers, enabling flexible log routing and structured output without changing application code.
flog · high confidence
Initial release of the Farseer.Go framework
The repository is initialized with the core framework code, including \initialize.go\ which provides the main entry point for application startup, module loading, and health checks. A comprehensive \config.yaml\ is added to configure databases, caches, logging, and other infrastructure components. The project also includes a \README.md\ with documentation and usage examples, a \LICENSE\ file (MIT), a \SECURITY.md\ policy, and a \.gitignore\ file.
(repo-wide) · high confidence
Introduce DateTime type with comprehensive time manipulation and formatting
A new \DateTime\ type is introduced in the \dateTime\ package, wrapping \time.Time\ to provide a fluent API for date and time operations. It includes methods for parsing and formatting (including custom layout support and millisecond precision), arithmetic operations (adding/subtracting years, months, days, hours, minutes, seconds, and milliseconds), and utility functions like \Now\, \Since\, and \ResetDay\. The type also supports serialization via JSON and MessagePack, and integrates with database scanning for GORM compatibility.
dateTime · high confidence
Introduce generic type conversion and utility functions in the parse package
The parse package now provides a generic \Convert\ function that handles type conversions between various data types, including strings, numbers, booleans, time types, and enums. It also introduces \IsEqual\ for value comparison, \HashCode\/\HashCode64\ for string hashing, and \RandString\ for generating random strings. These utilities support flexible data transformation and validation within the application.
parse · high confidence
Introduce new IoC container with full lifecycle management and injection support
Added a new Inversion of Control (IoC) container that supports registering and resolving dependencies by interface or type, with support for both single (singleton) and transient lifecycles. The container now provides methods to register constructors and instances, resolve dependencies, and perform field injection into existing objects. It also includes utilities to check if a type is registered, retrieve all instances of a specific interface, and remove unused or specific registered instances.
container · high confidence
Introduce structured exception handling with Try/Catch/ThrowUnCatch pattern
Added a new exception package providing a Try/Catch/ThrowUnCatch pattern for handling panics in Go. The package introduces specific exception types including RefuseException, WebException, and generic Exception, each with corresponding Throw and Catch methods (e.g., ThrowRefuseException, CatchRefuseException). The Try function wraps code execution to capture panics, allowing developers to handle specific exception types or fall back to a generic catch-all. If an exception is not explicitly caught, ThrowUnCatch re-throws the original panic, ensuring unhandled errors propagate up the stack. The implementation includes logging for unhandled exceptions and integrates with the existing trace context for debugging.
exception · high confidence
Introduces core framework interfaces and standardized API response structures
The core package now provides a set of new interfaces and types to standardize framework behavior and API responses. New interfaces include IEvent for publishing messages, IConnectionChecker for validating service connections, IHealthCheck for application health checks, ILock for distributed locking, ILog for structured logging, ITransaction for database transactions, and IMapperInit for mapper initialization. Additionally, a generic ApiResponse\[TData\] struct is introduced with specialized variants (Int, Long, String) and helper functions (Success, Error, Error403) to ensure consistent JSON responses across the application.
core · high confidence
New async concurrency primitives: Single and Worker
Added two new concurrency utilities to the async package. The Single struct provides a thread-safe way to ensure that concurrent requests with the same key execute only once, with other goroutines waiting for the result. The Worker struct offers a way to manage asynchronous task execution, supporting both custom goroutine scheduling and standard Go goroutines, with error handling and the ability to register callbacks to run after all tasks complete.
async · high confidence
New reflection-based type inspection and collection handling utilities
The types package now includes new files (collectionsType.go, dictionaryType.go, getType.go, isType.go, listType.go) that provide reflection-based utilities for inspecting and manipulating collection types. This includes functions to extract list/page/dictionary elements, determine if a type is a specific collection (List, Dictionary, PageList, etc.), identify Go basic types, and handle DTO model detection. The implementation uses caching (sync.Map and a custom cache with RWMutex) to optimize reflection lookups, which the commit messages indicate improves performance for complex object mapping.
types · high confidence
New trace package with comprehensive instrumentation for HTTP, MQ, Redis, and more
The trace package has been introduced to provide detailed instrumentation and tracing capabilities across the application. This includes a new \EmptyManager\ that serves as a default, no-op implementation of the \IManager\ interface, allowing for easy integration and testing. The package supports tracing for various components including HTTP requests (capturing headers, status codes, and body), message queues (MQ, RabbitMQ, Queue consumers), Redis, Elasticsearch, etcd, gRPC, and manual hand-tracing. Each trace detail captures specific metadata relevant to the component (e.g., SQL statements and rows affected for databases, routing keys for MQ). The system also supports hierarchical tracing with scope levels, exception handling with stack traces, and the ability to ignore specific traces or details. A test file is also added to verify the functionality of the trace components.
trace · high confidence
Stopwatch now supports microsecond and nanosecond precision
The stopwatch component has been refactored to support higher time resolutions. A new \StartNew\ method allows creating and starting a timer in one step, while \New\ creates a timer in a stopped state. The API now exposes \GetMicrosecondsText\ and \GetNanosecondsText\ alongside the existing millisecond and human-readable text methods, enabling users to track execution time with microsecond and nanosecond precision.
stopwatch · high confidence
Behavioural changes
Introduce flexible configuration loading with environment variable and remote support
The configure module now supports loading configuration from multiple sources with a defined priority: environment variables, YAML files, and a remote FOPS configuration center. Users can specify environment-specific YAML files (e.g., \config.{fsenv}.yaml\) and override local settings with remote configurations fetched from the FOPS center. The system also allows setting default values and parsing configuration strings into typed structs.
configure · high confidence
Introduce structured module initialization lifecycle
The framework now uses a structured module system to replace the previous \func init()\-based initialization. Modules can now implement specific lifecycle interfaces (\FarseerPreInitializeModule\, \FarseerInitializeModule\, \FarseerPostInitializeModule\, \FarseerShutdownModule\) to control their startup and shutdown sequence. The \FarseerKernelModule\ handles core setup like configuration and logging, while the \modules\ package provides dependency resolution, deduplication, and execution of these lifecycle methods in the correct order.
modules · high confidence
Platform-specific path and newline constants introduced
The path package now defines platform-specific constants for newline characters and path separators. On Darwin and Linux, the newline is a single line feed (\\n) and the path separator is a forward slash (/). On Windows, the newline is a carriage return and line feed (\\r\\n) and the path separator is a backslash (\\). This change ensures that path-related string constants are correctly adapted to each operating system's conventions.
path · high confidence
Switch to json-iterator for JSON handling
The snc package now uses the json-iterator library for JSON serialization and deserialization, replacing the previous implementation. This change introduces a new json.go file that wraps json-iterator's API to provide Unmarshal, UnmarshalFromString, Marshal, and MarshalIndent functions, with configuration for number handling and buffer sizes to optimize memory usage.
snc · high confidence
Updated local IP address selection to prioritize private network ranges
The logic for retrieving the local IP address has been changed to prefer specific private IP ranges in a defined order: 192.168.x.x, then 172.20.x.x, then 10.x.x.x, and finally falls back to the first available IP. This ensures that the application selects a more stable or local network address rather than any random interface.
net · high confidence
Test coverage
Added benchmark tests for parse.Convert and fastReflect; Added unit tests for core framework modules.
Dependencies
Update Go module dependencies and configuration
The project's go.mod file has been updated to specify Go 1.23 and define a new set of direct dependencies, including json-iterator/go v1.1.12, timandy/routine v1.1.6, gopkg.in/yaml.v3 v3.0.1, and github.com/vmihailenco/msgpack/v5 v5.4.1, alongside several indirect dependencies.
(dependencies) · medium confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 59 → 61 (+1.7)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 88 → 92 (+3.3)
- Architecture 100 → 97 (-2.9)
- Maturity 48 → 51 (+3.7)
- Readiness 59 → 58 (-0.8)
- Security 72 → 72 (+0.2)
Resolved (16)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 2) (container/container.go)
- Duplicated block (12 lines × 2) (container/container.go)
- Duplicated block (7 lines × 2) (parse/convert.go)
- Duplicated block (8 lines × 2) (fastReflect/valueMeta.go)
- High: security finding (details withheld)
- High: security finding (details withheld)
- LLM evaluation failed
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- Medium CVE: GO-2025-4006 (go.mod)
- No exposed public API
- Off-boarding risk: anonymized user #1
- Test reliability not included
New (29)
- Documentation: no installation or build instructions (README.md)
- Duplicated block (10 lines × 2) (container/container.go)
- Duplicated block (10 lines × 2) (container/container.go)
- Duplicated block (7 lines × 2) (fastReflect/type.go)
- Duplicated block (7 lines × 2) (fastReflect/valueMeta.go)
- FunctionTooLong: parse.Convert (parse/convert.go)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low cohesion: TraceContext (LCOM4 4) (trace/trackContext.go)
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- Medium CVE: GO-2025-4006 (go.mod)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- …and 9 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
farseer-go/fs was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2ae0fe7abf6d1bda1ed8398d2c603540b83679a8 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.