Documentation
¶
Overview ¶
Package systemd provides utilities for interacting with systemd units.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectBindMountHashes ¶ added in v0.31.1
CollectBindMountHashes computes SHA256 hashes for bind-mounted regular files within the project directory. Files outside the project dir, directories, and unreadable files are skipped.
func ComputeUnitState ¶ added in v0.31.1
ComputeUnitState computes content and bind mount hashes for change detection. It hashes the rendered unit file content and any bind-mounted regular files whose source paths are within the project directory.
func WriteUnits ¶ added in v0.31.1
WriteUnits writes each unit to a separate file in the quadlet directory.
Types ¶
type Client ¶ added in v0.30.0
type Client interface {
Start(ctx context.Context, units ...string) error
Stop(ctx context.Context, units ...string) error
Restart(ctx context.Context, units ...string) error
Reload(ctx context.Context, units ...string) error
DaemonReload(ctx context.Context) error
Enable(ctx context.Context, units ...string) error
Disable(ctx context.Context, units ...string) error
Close() error
}
Client provides operations for managing systemd units via D-Bus.
type Unit ¶
Unit represents a systemd unit file.
func BuildContainer ¶ added in v0.30.0
func BuildContainer(projectName, serviceName string, svc *types.ServiceConfig, projectNetworks types.Networks, projectVolumes types.Volumes) Unit
BuildContainer converts a compose service into a container unit file. projectNetworks provides the project-level network configs so that external networks can be referenced by name rather than as Quadlet unit files.
func BuildNetwork ¶ added in v0.30.0
func BuildNetwork(projectName, netName string, net *types.NetworkConfig) Unit
BuildNetwork converts a compose network into a network unit file.
func BuildVolume ¶ added in v0.30.0
func BuildVolume(projectName, volName string, vol *types.VolumeConfig) Unit
BuildVolume converts a compose volume into a volume unit file.