Help us shape the future of Go! Take the 2026 Go Developer Survey

fundamentals

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 0 Imported by: 0

README

Fundamentals for Go

Go Reference Build Release

The Go counterpart of Cratis Fundamentals: shared domain-value primitives for Arc.Go and Chronicle.Go. Instead of each framework defining incompatible values and codecs, Fundamentals.Go provides one small, standard-library-only foundation. It must never import either framework.

Status

Experimental (v0.x). Package concepts provides UUID, DateOnly, TimeOnly, TimeSpan, the Concept contract, Underlying and CheckJSON. Package concepts/conceptstypes provides matching compile-time recognition for generators using go/types. Package correlation provides shared correlation-ID context. Package naming shares acronym-friendly casing and explicit naming policies, without choosing product defaults. Package dependencyinjection provides an optional dependency-injection contract, with a default container and conformance suites; plain constructors need none of it. Start with concept authoring and recognition and dependency injection; the parity map records implemented contracts and remaining gaps.

Releases remain v0.x while the API is experimental; a minor version may contain breaking changes, with migration notes.

Installation

Requires Go 1.26 or later:

go get github.com/cratis/fundamentals.go@latest

Use the lowercase module path exactly as shown. CI checks Go 1.26 and 1.27 with GOWORK=off and GOTOOLCHAIN=local.

Development

From the repository root:

export GOWORK=off
export GOTOOLCHAIN=local
go build ./...
go vet ./...
go test -race -count=1 -timeout=3m ./...
golangci-lint run

See the contribution guide for the full checks and release conventions, and the documentation overview for scope and limitations.

Community and security

License

MIT.

Documentation

Overview

Package fundamentals is the root of the Go counterpart of Cratis Fundamentals.

Package concepts provides the shared UUID and temporal wire scalars and the typed concept contract; package correlation shares correlation IDs through context.Context; package dependencyinjection provides an optional dependency-injection contract and default container. Documentation/parity.md records the remaining gaps.

Directories

Path Synopsis
Package concepts provides portable UUID, DateOnly, TimeOnly and TimeSpan values with .NET-compatible canonical JSON strings and text codecs.
Package concepts provides portable UUID, DateOnly, TimeOnly and TimeSpan values with .NET-compatible canonical JSON strings and text codecs.
conceptstypes
Package conceptstypes recognizes typed scalar concepts from go/types metadata for generators and analyzers.
Package conceptstypes recognizes typed scalar concepts from go/types metadata for generators and analyzers.
internal/corpus
Package corpus holds declarations shared by reflect and go/types recognition tests.
Package corpus holds declarations shared by reflect and go/types recognition tests.
Package correlation shares operation correlation IDs through context.Context.
Package correlation shares operation correlation IDs through context.Context.
Package dependencyinjection defines container-neutral exact-type registration, resolution and scope contracts.
Package dependencyinjection defines container-neutral exact-type registration, resolution and scope contracts.
bindingtypes
Package bindingtypes plans constructor registrations over already type-checked Go packages.
Package bindingtypes plans constructor registrations over already type-checked Go packages.
container
Package container implements the optional default dependency injection provider.
Package container implements the optional default dependency injection provider.
ditest
Package ditest provides reusable dependency injection conformance suites.
Package ditest provides reusable dependency injection conformance suites.
internal/bindingcorpus/competitor
Package competitor adds constructorless, ignored structural competition.
Package competitor adds constructorless, ignored structural competition.
internal/bindingcorpus/declarationcompetitor
Package declarationcompetitor exposes constructorless generic competitors.
Package declarationcompetitor exposes constructorless generic competitors.
internal/bindingcorpus/directives
Package directives supplies valid type-attached policies.
Package directives supplies valid type-attached policies.
internal/bindingcorpus/forms
Package forms supplies constructor shapes.
Package forms supplies constructor shapes.
internal/bindingcorpus/genericcompetitor
Package genericcompetitor supplies open structural implementation families.
Package genericcompetitor supplies open structural implementation families.
internal/bindingcorpus/genericforward
Package genericforward exposes a closed generic convention implementation.
Package genericforward exposes a closed generic convention implementation.
internal/bindingcorpus/invaliddirectives
Package invaliddirectives supplies conflicting and misplaced comments.
Package invaliddirectives supplies conflicting and misplaced comments.
internal/bindingcorpus/render
Package render supplies a runtime fixture for hand-authored product rendering.
Package render supplies a runtime fixture for hand-authored product rendering.
internal/bindingcorpus/renderfailure
Package renderfailure supplies analyzed runtime ownership regressions.
Package renderfailure supplies analyzed runtime ownership regressions.
internal/bindingcorpus/unique
Package unique supplies a unique pointer-method-set convention pair.
Package unique supplies a unique pointer-method-set convention pair.
internal/value
Package value centralizes runtime validation for contracts and container adapters.
Package value centralizes runtime validation for contracts and container adapters.
internal
typeinspection
Package typeinspection supplies non-mutating views of checked Go types.
Package typeinspection supplies non-mutating views of checked Go types.
Package naming shares Cratis Fundamentals' acronym-friendly camel casing, first-character Pascal casing, and explicit naming policies.
Package naming shares Cratis Fundamentals' acronym-friendly camel casing, first-character Pascal casing, and explicit naming policies.

Jump to

Keyboard shortcuts

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