v1.20.1 Latest Latest

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 3



Package version provides information about FerretDB version and build configuration.

Required files

The following generated text files may be present in this (`build/version`) directory during building:

  • version.txt (required) contains information about the FerretDB version in a format similar to `git describe` output: `v<major>.<minor>.<patch>`.
  • commit.txt (optional) contains information about the source git commit.
  • branch.txt (optional) contains information about the source git branch.
  • package.txt (optional) contains package type (e.g. "deb", "rpm", "docker", etc).

Go build tags

The following Go build tags (also known as build constraints) affect all builds of FerretDB, including embedded usage:

ferretdb_debug			- enables debug build (see below; implied by builds with race detector)
ferretdb_hana			- enables Hana backend (alpha)
ferretdb_no_postgresql	- disables PostgreSQL backend
ferretdb_no_sqlite		- disables SQLite backend

Debug builds

Debug builds of FerretDB behave differently in a few aspects:

  • Some values that are normally randomized are fixed or less randomized to make debugging easier.
  • Some internal errors cause crashes instead of being handled more gracefully.
  • Stack traces are collected more liberally.
  • Metrics are written to stderr on exit.
  • The default logging level is set to debug.

Debug builds are orthogonal to production releases, development releases, and local/host builds. For example, the host build could be made non-debug, and the production release, in theory, could be a debug build.

Currently, our production releases are non-debug builds, and all other builds and releases (development releases, all-in-one releases, local builds, etc.) are debug builds.



This section is empty.


This section is empty.


This section is empty.


type Info

type Info struct {
	Version          string
	Commit           string
	Branch           string
	Dirty            bool
	Package          string
	DebugBuild       bool
	BuildEnvironment *types.Document

	// MongoDBVersion is fake MongoDB version for clients that check major.minor to adjust their behavior.
	MongoDBVersion string

	// MongoDBVersionArray is MongoDBVersion, but as an array.
	MongoDBVersionArray *types.Array

Info provides details about the current build.

func Get

func Get() *Info

Get returns current build's info.

Jump to

Keyboard shortcuts

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