upgraded

package
v0.0.0-...-d2438c5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	db.ClusterTransactioner
	db.ClusterExclusiveLocker

	// NodeID sets the the node NodeID associated with this cluster instance. It's used for
	// backward-compatibility of all db-related APIs that were written before
	// clustering and don't accept a node NodeID, so in those cases we automatically
	// use this value as implicit node NodeID.
	NodeID(int64)
}

Cluster mediates access to data stored in the cluster dqlite database.

type Node

type Node interface {
	db.NodeTransactioner
}

Node mediates access to the data stored in the node-local SQLite database.

type Notifier

type Notifier interface {

	// Run is a function that invokes the given function against each node in
	// the cluster excluding the invoking one.
	Run(func(*client.Client) error, notifier.Policy) error
}

Notifier is a function that invokes the given function against each node in the cluster excluding the invoking one.

type NotifierProvider

type NotifierProvider interface {

	// New creates a new Notifier using a cert
	New(State, *cert.Info, config.Schema) Notifier
}

NotifierProvider creates a new Notifier as a dependency

type OS

type OS interface {

	// LocalDatabasePath returns the path of the local database file.
	LocalDatabasePath() string

	// GlobalDatabaseDir returns the path of the global database directory.
	GlobalDatabaseDir() string

	// GlobalDatabasePath returns the path of the global database SQLite file
	// managed by dqlite.
	GlobalDatabasePath() string

	// VarDir represents the Data directory (e.g. /var/lib/therm/).
	VarDir() string
}

OS is a high-level facade for accessing all operating-system level functionality that therm uses.

type Option

type Option func(*options)

Option to be passed to Connect to customize the resulting instance.

func WithCert

func WithCert(certInfo *cert.Info) Option

WithCert sets the certInfo on the options

func WithNodeConfigSchema

func WithNodeConfigSchema(nodeConfigSchema config.Schema) Option

WithNodeConfigSchema sets the node configuration schema on the options

func WithNotifierProvider

func WithNotifierProvider(notifierProvider NotifierProvider) Option

WithNotifierProvider sets the notifierProvider on the options

func WithState

func WithState(state State) Option

WithState sets the state on the options

type State

type State interface {
	// Node returns the underlying Node
	Node() Node

	// Cluster returns the underlying Cluster
	Cluster() Cluster

	// OS returns the underlying OS values
	OS() OS
}

State is a gateway to the two main stateful components, the database and the operating system. It's typically used by model entities in order to perform changes.

type Upgraded

type Upgraded struct {
	// contains filtered or unexported fields
}

Upgraded defines a task, that when run notifies back that a upgrade task has been completed

func New

func New(state State, certInfo *cert.Info, nodeConfigSchema config.Schema, options ...Option) *Upgraded

New creates a Upgrade task with sane defaults

func (*Upgraded) Run

func (u *Upgraded) Run() error

Run sends a notification to all other nodes in the cluster that any possible pending database update has been applied, and any nodes which was waiting for this node to be upgraded should re-check if it's okay to move forward.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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