Documentation
¶
Index ¶
Constants ¶
const DevelopmentVersion = "development"
DevelopmentVersion is the value of NetbirdVersion() for non-release builds. Wire-format consumers (management server, dashboard) match against this string, so it must not change without coordinating those consumers.
Variables ¶
var ( VersionRegexp = regexp.MustCompile("^" + v.VersionRegexpRaw + "$") SemverRegexp = regexp.MustCompile("^" + v.SemverRegexpRaw + "$") )
Functions ¶
func DownloadUrl ¶ added in v0.24.3
func DownloadUrl() string
DownloadUrl return with the proper download link
func IsDevelopmentVersion ¶ added in v0.72.0
IsDevelopmentVersion reports whether the given version string identifies a non-release / development build. It is the single source of truth for "is this a dev build" checks across the codebase; use it instead of comparing against the "development" literal or ad-hoc substring checks.
Matches the bare DevelopmentVersion constant as well as any future extension such as "development-<sha>" or "development-<sha>-dirty", while excluding tagged prereleases like "v0.31.1-dev".
func NetbirdCommit ¶ added in v0.72.0
func NetbirdCommit() string
NetbirdCommit returns the VCS revision (truncated to 12 chars) of the build, with a "-dirty" suffix when the working tree was modified. Returns an empty string when no build info is embedded (e.g. release builds compiled by goreleaser without -buildvcs).
func NetbirdVersion ¶
func NetbirdVersion() string
NetbirdVersion returns the Netbird version. For non-release builds the value is the literal DevelopmentVersion constant; the VCS revision is exposed separately via NetbirdCommit so the wire format stays stable.
Types ¶
type Update ¶ added in v0.24.3
type Update struct {
// contains filtered or unexported fields
}
Update fetch the version info periodically and notify the onUpdateListener in case the UI version or the daemon version are deprecated
func NewUpdate ¶ added in v0.24.3
NewUpdate instantiate Update and start to fetch the new version information
func NewUpdateAndStart ¶ added in v0.61.0
func (*Update) LatestVersion ¶ added in v0.61.0
func (*Update) SetDaemonVersion ¶ added in v0.24.3
SetDaemonVersion update the currently running daemon version. If new version is available it will trigger the onUpdateListener
func (*Update) SetOnUpdateListener ¶ added in v0.24.3
func (u *Update) SetOnUpdateListener(updateFn func())
SetOnUpdateListener set new update listener
func (*Update) StartFetcher ¶ added in v0.61.0
func (u *Update) StartFetcher()