Fundamentals for Go
Fundamentals for Go provides shared domain-value primitives for Go programs and the Cratis Go frameworks. Without it, each consumer must define its own UUID, date, time and concept codecs. With it, you share precise scalar contracts while keeping domain identity in your own Go types.
Start with a UUID-backed author and a JSON round trip. You need Go 1.26 or later, not a server, DI container or C# background.
Packages
Section titled “Packages”This documentation targets the root module v0.3.2; the API remains experimental.
It uses only the standard library. Minor v0 releases may change APIs with migration
notes. Install the lowercase module path
github.com/cratis/fundamentals.go@v0.3.2; see release status.
Beginning with v0.3.0, concepts.ParseDotNetGUID adds explicit .NET 10.0.12
compatibility conversion without changing strict UUID defaults.
| Your task | Package and guide |
|---|---|
| Parse and serialize IDs, dates, times and durations | concepts: scalar reference |
| Define nominal domain values and validate their scalar output | concepts: typed concepts |
| Recognize concepts without executing application code | concepts/conceptstypes: compile-time recognition |
| Propagate operation metadata without globals | correlation: correlation context |
| Share explicit property/model naming rules | naming: naming policies |
| Compose services and manage resource lifetimes | dependencyinjection and dependencyinjection/container: optional DI |
| Plan registrations from type-checked constructors | dependencyinjection/bindingtypes: constructor planning |
| Qualify a custom resolver or provider in tests | dependencyinjection/ditest: conformance levels |
The root fundamentals package contains package documentation, not runtime
entry points. Ecosystem recipes demonstrate UUID-library conversion,
native borrowed-singleton resolvers, Fx hosting and package loading. They live in
a separate unpublished module and do not add dependencies to the root.
Scope and compatibility
Section titled “Scope and compatibility”This is a foundation, not an HTTP host, event store, universal serializer or application framework. Ordinary constructors remain the first choice; no other capability requires the optional container. The accepted integration decision keeps standard interfaces and recipes ahead of additional integration modules.
The parity map distinguishes implemented contracts, deliberate Go adaptations and remaining C# gaps. Package documentation does not mean whole-product parity. Enum JSON compatibility and dictionary-key JSON compatibility describe source-distributed contract fixtures included with v0.3.0, not Go enum or complex-key codecs, runtime or schema support.
Contribute or publish
Section titled “Contribute or publish”The contribution guide covers both modules’ local checks. Release policy covers immutable tags, proxy indexing and recovery; project context describes the contributor workflow. Fundamentals must not import its consumers, Arc.Go or Chronicle.Go. Consumer adoption and compatibility must be verified in those products independently.