versions

package
v0.0.0-test Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatestOptions = Options{
	Autocomplete:       NewNullable(true),
	CombinedExecutable: NewNullable(true),
	DebPreRM:           NewNullable(true),
}

LatestOptions are the options that apply to the latest version of Grafana

View Source
var OptionsList = []Options{
	{
		Constraint: NewNullable("< 9.5.0-0"),
		DebPreRM:   NewNullable(false),
	},
	{
		Constraint:         NewNullable("< 9.3.7-0"),
		CombinedExecutable: NewNullable(false),
	},
	{
		Constraint:   NewNullable("< 9.4.0-0"),
		Autocomplete: NewNullable(false),
	},
	{
		Constraint:         NewNullable(">= 9.2.11-0, < 9.3.0-0"),
		CombinedExecutable: NewNullable(true),
	},
}

OptionsList is a list of semver filters and corresponding options. If multiple constraints match the given semver, then they are merged in the order they appear, where later entries override earlier ones. These options should only exist if they are contrary to the LatestOptions, as the applicable options will be merged with it. In the event of any conflicts, the options in this list will override those in the LatestOptions.

Functions

This section is empty.

Types

type Nullable

type Nullable[T any] struct {
	Value T
	IsSet bool
}

func MergeNullables

func MergeNullables[T any](values ...Nullable[T]) Nullable[T]

func NewNullable

func NewNullable[T any](val T) Nullable[T]

type Options

type Options struct {
	Constraint Nullable[string]
	// CombinedExecutable was introduced in Grafana 9.4; it combined the `grafana-server` and `grafana-cli` commands into one `grafana` executable.
	CombinedExecutable Nullable[bool]
	// DebPreRM defines the 'prerm' script in the debian installer, introduced by this PR: https://github.com/grafana/grafana/pull/59580 in v9.5.0. Versions before v9.5.0 do not have the 'prerm' script in the grafana package.
	DebPreRM Nullable[bool]

	// Automcplete (in packaging/autocomplete) was added in Grafana 9.4.0, so we should not try to include this folder in the package before then.
	Autocomplete Nullable[bool]
}

Options holds the general options for each version that may be different.

func Merge

func Merge(from, to Options) Options

func OptionsFor

func OptionsFor(version string) Options

OptionsFor returns the options found for a given version. If no versions that matched were found, then the result of "LatestOptions" is returned.

Jump to

Keyboard shortcuts

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