sys

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DqliteSocket is the configurable location of the dqlite socket.
	DqliteSocket = "DQLITE_SOCKET"

	// StateDir is the location of the daemon state directory.
	StateDir = "STATE_DIR"

	// SchemaUpdate is the path to the schema update to run.
	SchemaUpdate = "SCHEMA_UPDATE"

	// SocketGroup is the configurable group of the socket.
	SocketGroup = "SOCKET_GROUP"
)

Variables

This section is empty.

Functions

func DefaultOS

func DefaultOS(stateDir string, createDir bool) (types.OS, error)

DefaultOS returns a fresh uninitialized OS instance with default values.

Types

type OS

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

OS contains fields and methods for interacting with the state directory.

func (*OS) CertificatesDir

func (s *OS) CertificatesDir() string

CertificatesDir gets the state's certificates directory.

func (*OS) ClusterCert

func (s *OS) ClusterCert() (*shared.CertInfo, error)

ClusterCert gets the local cluster certificate from the state directory.

func (*OS) ControlSocket

func (s *OS) ControlSocket() *url.URL

ControlSocket returns the full path to the control.socket file that this daemon is listening on.

func (*OS) ControlSocketPath

func (s *OS) ControlSocketPath() string

ControlSocketPath returns the filesystem path to the control socket.

func (*OS) DatabaseDir

func (s *OS) DatabaseDir() string

DatabaseDir gets the state's database directory.

func (*OS) DatabasePath

func (s *OS) DatabasePath() string

DatabasePath returns the path of the database file managed by dqlite.

func (*OS) IsControlSocketPresent

func (s *OS) IsControlSocketPresent() (bool, error)

IsControlSocketPresent determines if the control socket is present and accessible.

func (*OS) ServerCert

func (s *OS) ServerCert() (*shared.CertInfo, error)

ServerCert gets the local server certificate from the state directory.

func (*OS) StateDir

func (s *OS) StateDir() string

StateDir gets the state's base directory.

func (*OS) TrustDir

func (s *OS) TrustDir() string

TrustDir gets the state's trust directory.

type Watcher

type Watcher struct {
	*fsnotify.Watcher
	// contains filtered or unexported fields
}

Watcher represents an fsnotify watcher.

func NewWatcher

func NewWatcher(ctx context.Context, root string) (*Watcher, error)

NewWatcher returns a watcher listening for fsnotify events down the given dir.

func (*Watcher) Watch

func (w *Watcher) Watch(path string, fileExt string, f func(path string, event fsnotify.Op) error) error

Watch adds a hook to be executed on create/remove events on files with the given extension under the given path.

Jump to

Keyboard shortcuts

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