selfupdate

package
v0.0.0-...-1d8dca5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSelfUpdateManager

func NewSelfUpdateManager(opts []MgrOpt, registryCtx *registry.ServiceRegistryContext) (orchestration.UpdateManager, error)

NewSelfUpdateManager instantiates a new self update manager

Types

type ApplyResult

type ApplyResult struct {
	Result         OperationResult
	RebootTimeout  time.Duration
	RebootRequired bool
	Err            error
}

ApplyResult holds the result of a self update apply

type MgrOpt

type MgrOpt func(mgrOptions *mgrOpts) error

MgrOpt defines the creation configuration options for a self update manager implementation

func WithConnectionAcknowledgeTimeout

func WithConnectionAcknowledgeTimeout(acknowledgeTimeout time.Duration) MgrOpt

WithConnectionAcknowledgeTimeout configures the timeout for the acknowledge receival

func WithConnectionBroker

func WithConnectionBroker(broker string) MgrOpt

WithConnectionBroker configures the broker, where the connection will be established

func WithConnectionClientPassword

func WithConnectionClientPassword(password string) MgrOpt

WithConnectionClientPassword configures the client password used when establishing connection to the broker

func WithConnectionClientUsername

func WithConnectionClientUsername(username string) MgrOpt

WithConnectionClientUsername configures the client username used when establishing connection to the broker

func WithConnectionConnectTimeout

func WithConnectionConnectTimeout(connectTimeout time.Duration) MgrOpt

WithConnectionConnectTimeout configures the timeout before terminating the connect attempt

func WithConnectionDisconnectTimeout

func WithConnectionDisconnectTimeout(disconnectTimeout time.Duration) MgrOpt

WithConnectionDisconnectTimeout configures the duration of inactivity before disconnecting from the broker

func WithConnectionKeepAlive

func WithConnectionKeepAlive(keepAlive time.Duration) MgrOpt

WithConnectionKeepAlive configures the time between between each check for the connection presence

func WithConnectionSubscribeTimeout

func WithConnectionSubscribeTimeout(subscribeTimeout time.Duration) MgrOpt

WithConnectionSubscribeTimeout configures the timeout before terminating the subscribe attempt

func WithConnectionUnsubscribeTimeout

func WithConnectionUnsubscribeTimeout(unsubscribeTimeout time.Duration) MgrOpt

WithConnectionUnsubscribeTimeout configures the timeout before terminating the unsubscribe attempt

func WithEnableReboot

func WithEnableReboot(reboot bool) MgrOpt

WithEnableReboot configures the required reboot parameter to the self update manager runtime configuration

func WithRebootTimeout

func WithRebootTimeout(rebootTimeout string) MgrOpt

WithRebootTimeout configures the reboot timeout parameter to the self update manager runtime configuration

func WithTimeout

func WithTimeout(timeout string) MgrOpt

WithTimeout configures the timeout parameter to the self update manager runtime configuration

type OperationResult

type OperationResult int

OperationResult holds the result of a self update operation

const (
	//SelfUpdateNoResult represents a self update operation initial state
	SelfUpdateNoResult OperationResult = iota
	// SelfUpdateResultInstalled represents a self update operation finished successfully
	SelfUpdateResultInstalled
	// SelfUpdateResultRejected represents a self rejected update operation
	SelfUpdateResultRejected
	// SelfUpdateResultError represents a self update operation failed with error
	SelfUpdateResultError
	// SelfUpdateResultTimeout represents a self update operation failed with expired timeout
	SelfUpdateResultTimeout
)

Jump to

Keyboard shortcuts

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