releases

package
v1.23.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndLogRunE

func CheckAndLogRunE() cobrautil.CobraRunFunc

CheckAndLogRunE is a run function that checks if the current version of SpiceDB is the latest and, if not, logs a warning. This check is disabled by setting --skip-release-check=false.

func CheckIsLatestVersion

func CheckIsLatestVersion(
	ctx context.Context,
	getCurrentVersion func() (string, error),
	getLatestRelease func(context.Context) (*Release, error),
) (SoftwareUpdateState, string, *Release, error)

CheckIsLatestVersion returns whether the current version of the software is the latest released. Returns the state, as well as the latest release.

func CurrentVersion

func CurrentVersion() (string, error)

CurrentVersion returns the current version of the binary.

func GetSourceRepository added in v1.20.0

func GetSourceRepository() string

GetSourceRepository returns the source repository path for SpiceDB.

func RegisterFlags

func RegisterFlags(flagset *flag.FlagSet)

RegisterFlags registers the flags for the CheckAndLogRunE function.

Types

type Release

type Release struct {
	// Version is the version of the release.
	Version string

	// PublishedAt is when the release was published, in UTC.
	PublishedAt time.Time

	// ViewURL is the URL at which the release can be viewed.
	ViewURL string
}

Release represents a release of SpiceDB.

func GetLatestRelease

func GetLatestRelease(ctx context.Context) (*Release, error)

GetLatestRelease returns the latest release of SpiceDB, as reported by the GitHub API.

type SoftwareUpdateState

type SoftwareUpdateState int

SoftwareUpdateState is the state of this software relative to whether updates are available.

const (
	// Unknown indicates an unknown state.
	Unknown SoftwareUpdateState = iota

	// UnreleasedVersion indicates that the current software version running is an unreleased version.
	UnreleasedVersion

	// UpdateAvailable indicates an update is available.
	UpdateAvailable

	// UpToDate indicates that the software is fully up-to-date.
	UpToDate
)

Jump to

Keyboard shortcuts

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