Documentation
¶
Overview ¶
Package systemd contains the trusted target and transport implementation used by systemd-aware builtins.
Index ¶
- Constants
- type Client
- func (c *Client) DisableSystemServices(ctx context.Context, units []string) error
- func (c *Client) EnableSystemServices(ctx context.Context, units []string) error
- func (c *Client) InspectSystemServices(ctx context.Context, units []string) ([]builtins.SystemServiceState, error)
- func (c *Client) JournalDiskUsage(ctx context.Context) (builtins.JournalUsage, error)
- func (c *Client) ListSystemServices(ctx context.Context, request builtins.SystemServiceListRequest) ([]builtins.SystemServiceState, error)
- func (c *Client) ReadJournal(ctx context.Context, query builtins.JournalQuery, ...) error
- func (c *Client) RotateJournal(ctx context.Context) error
- func (c *Client) RunSystemServiceJobs(ctx context.Context, action builtins.SystemServiceJobAction, units []string) error
- func (c *Client) VacuumJournal(ctx context.Context, request builtins.JournalVacuumRequest) (builtins.JournalVacuumResult, error)
- type Target
Constants ¶
const MaxJournalDirs = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the trusted systemd backends for one resolved target. Target paths are copied at construction so runner configuration remains immutable while commands execute.
func (*Client) DisableSystemServices ¶
func (*Client) EnableSystemServices ¶
func (*Client) InspectSystemServices ¶
func (*Client) JournalDiskUsage ¶
JournalDiskUsage reports allocated blocks, matching journalctl's disk-usage semantics more closely than summing logical file lengths.
func (*Client) ListSystemServices ¶
func (c *Client) ListSystemServices(ctx context.Context, request builtins.SystemServiceListRequest) ([]builtins.SystemServiceState, error)
func (*Client) ReadJournal ¶
func (c *Client) ReadJournal(ctx context.Context, query builtins.JournalQuery, yield func(builtins.JournalEntry) error) error
ReadJournal reads a bounded structured query from the configured journal files. Results are buffered until the file snapshot is stable, then yielded oldest first as required by builtins.JournalReader.
func (*Client) RotateJournal ¶
RotateJournal asks journald to rotate active journals and waits for the daemon to report completion.
func (*Client) RunSystemServiceJobs ¶
func (*Client) VacuumJournal ¶
func (c *Client) VacuumJournal(ctx context.Context, request builtins.JournalVacuumRequest) (builtins.JournalVacuumResult, error)
VacuumJournal deletes only strictly recognized archived journals from the configured target while honoring the requested size and time thresholds.
type Target ¶
type Target struct {
JournalDirs []string
MachineIDPath string
JournalControlSocket string
ManagerBusSocket string
}
Target identifies one systemd host through journal paths supplied by the embedding application.
func LocalTarget ¶
func LocalTarget() Target
LocalTarget returns the standard paths for the local systemd host.
func ResolveTarget ¶
ResolveTarget validates and resolves a target. A zero target selects the local host. Once any explicit field is supplied, omitted fields remain empty and never fall back to local paths.
Source Files
¶
- client.go
- journal_data.go
- journal_entry.go
- journal_file_unix.go
- journal_files.go
- journal_format.go
- journal_hash.go
- journal_index.go
- journal_merge.go
- journal_query.go
- journal_query_file.go
- journal_read.go
- journal_rotate_linux.go
- journal_snapshot.go
- journal_usage_unix.go
- journal_vacuum_unix.go
- journal_varlink.go
- journal_varlink_dial_linux.go
- manager_dbus_limit.go
- manager_incoming.go
- manager_linux.go
- manager_protocol.go
- manager_signal.go
- target.go
- target_path.go