version

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package version provides information about what Bacalhau was built from.

The bulk of the information comes from the debug.BuildInfo struct which gets automatically populated when building a binary as a Go module (`go build .` vs `go build main.go`) with Go 1.18+. It contains various things such as VCS information or dependencies.

Index

Constants

View Source
const DevelopmentGitVersion = "v0.0.0-xxxxxxx"

Variables

View Source
var (
	// GITVERSION is the Git tag that Bacalhau was built from. This is expected to be populated via the `ldflags` flag,
	// at least until https://github.com/golang/go/issues/50603 is fixed. The value shown here will be used when the
	// value isn't provided by ldflags.
	//
	// A good article on how to use buildflags is
	// https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications.
	GITVERSION = DevelopmentGitVersion
)

Functions

func Get

func Get() *models.BuildVersionInfo

Get returns the overall codebase version. It's for detecting what code a binary was built from.

func LogUpdateResponse added in v1.1.2

func LogUpdateResponse(ctx context.Context, ucr *UpdateCheckResponse)

func RunUpdateChecker added in v1.1.2

func RunUpdateChecker(
	ctx context.Context,
	getServerVersion func(context.Context) (*models.BuildVersionInfo, error),
	responseCallback func(context.Context, *UpdateCheckResponse),
)

RunUpdateChecker starts a goroutine that will periodically make an update check according to the configured update frequency and check skipping. The goroutine is ended by canceling the passed context. `getServerVersion` is allowed to return a nil version if there is no server to communicate with (e.g. because the node running the update check is the server).

Types

type UpdateCheckResponse added in v1.1.2

type UpdateCheckResponse struct {
	Version *models.BuildVersionInfo `json:"version"`
	Message string                   `json:"message"`
}

func CheckForUpdate added in v1.1.2

func CheckForUpdate(
	ctx context.Context,
	currentClientVersion, currentServerVersion *models.BuildVersionInfo,
	clientID string,
	InstallationID string,
) (*UpdateCheckResponse, error)

Jump to

Keyboard shortcuts

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