version

package
v1.105.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVersionNotification added in v1.17.1

func NewVersionNotification(timesSent notifications.TimesNotified, suggestedVersion version.SemVer, senderID storj.NodeID) (_ notifications.NewNotification)

NewVersionNotification - returns version update required notification.

Types

type Chore

type Chore struct {
	Loop *sync2.Cycle
	// contains filtered or unexported fields
}

Chore contains the information and variables to ensure the Software is up to date for storagenode.

func NewChore

func NewChore(log *zap.Logger, service *checker.Service, notifications *notifications.Service, nodeID storj.NodeID, checkInterval time.Duration) *Chore

NewChore creates a Version Check Client with default configuration for storagenode.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run logs the current version information and detects if software outdated, if so - sends notifications.

func (*Chore) RunOnce added in v1.98.1

func (chore *Chore) RunOnce(ctx context.Context) (err error)

RunOnce is like Run but only runs once.

func (*Chore) TestCheckVersion added in v1.9.1

func (chore *Chore) TestCheckVersion() (relevance Relevance)

TestCheckVersion returns chore.relevance, used for chore tests only.

func (*Chore) TestSetNow added in v1.9.1

func (chore *Chore) TestSetNow(now func() time.Time)

TestSetNow allows tests to have the Service act as if the current time is whatever they want. This avoids races and sleeping, making tests more reliable and efficient.

type Config added in v1.98.1

type Config struct {
	checker.Config

	RunMode Mode `help:"Define the run mode for the version checker. Options (once,periodic,disable)" default:"periodic"`
}

Config is the config for the Storagenode Version Checker.

type Mode added in v1.98.1

type Mode string

Mode is the mode to run the version checker in.

func ParseCheckerMode added in v1.98.1

func ParseCheckerMode(s string) (Mode, error)

ParseCheckerMode parses the string representation of the CheckerMode.

func (*Mode) Disabled added in v1.98.1

func (m *Mode) Disabled() bool

Disabled returns true if the checker is disabled.

func (*Mode) Once added in v1.98.1

func (m *Mode) Once() bool

Once returns true if the checker is once.

func (*Mode) Periodic added in v1.98.1

func (m *Mode) Periodic() bool

Periodic returns true if the checker is periodic.

func (*Mode) Set added in v1.98.1

func (m *Mode) Set(s string) error

Set implements pflag.Value.

func (*Mode) String added in v1.98.1

func (m *Mode) String() string

String implements pflag.Value.

func (*Mode) Type added in v1.98.1

func (m *Mode) Type() string

Type implements pflag.Value.

type Relevance added in v1.8.1

type Relevance struct {
	ExpectedVersion  version.SemVer
	IsOutdated       bool
	FirstTimeSpotted time.Time
	TimesNotified    notifications.TimesNotified
}

Relevance contains information about software being outdated.

Jump to

Keyboard shortcuts

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