Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnsafeSetCluster ¶
UnsafeSetCluster modifies the underlying state to set the cluster upon the state
Types ¶
type Cluster ¶
type Cluster interface { database.DBAccessor db.ClusterOpener db.ClusterExclusiveLocker db.ClusterTransactioner // 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) // SchemaVersion returns the underlying schema version for the cluster SchemaVersion() int // Close the database facade. Close() error }
Cluster mediates access to data stored in the cluster dqlite database.
type Node ¶
type Node interface { database.DBAccessor db.NodeOpener db.NodeTransactioner // Dir returns the directory of the underlying database file. Dir() string // Close the database facade. Close() error }
Node mediates access to the data stored in the node-local SQLite database.
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 // Hostname returns the host name reported by the kernel. Hostname() (string, error) // HostNames will generate a list of names for which the certificate will be // valid. // This will include the hostname and ip address HostNames() ([]string, error) // User returns the current user. User() (*user.User, error) }
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 New to customize the resulting instance.
func WithCluster ¶
WithCluster sets the cluster on the options
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is a gateway to the two main stateful components, the database and the operating system. It's typically used by model entities such as containers, volumes, etc. in order to perform changes.
Click to show internal directories.
Click to hide internal directories.