Open-Source Wikis

/

CockroachDB

/

Packages

/

base

cockroachdb/cockroach

base

pkg/base/ holds primitive server-config types. It exists to break circular imports between pkg/server/, pkg/cli/, pkg/security/, and pkg/kv/kvserver/, all of which need to share configuration types without depending on each other.

What's in it

  • config.goConfig and RaftConfig.
  • addr_validation.go — host:port parsing and validation.
  • cluster_id.goClusterIDContainer (atomically-set cluster ID).
  • node_id.goNodeIDContainer.
  • store_spec.go--store=... flag parsing for cockroach start.
  • tenant_id.goTenantIDContainer.
  • test_*.go — small test helpers.

Why it's a separate package

The container types (ClusterIDContainer, NodeIDContainer) provide atomic accessors over an int that can be set once. They are reachable from both KV and SQL layers without either depending on the other.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

base – CockroachDB wiki | Factory