systemd

package
v1.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package systemd is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// EnsurePatterns sets the match patterns for systemd units.
	EnsurePatterns([]string) error
	// AddExclusions adds service names to the exclusion list.
	// Excluded services will not be reported in status even if they match patterns.
	AddExclusions(serviceNames ...string)
	// RemoveExclusions removes service names from the exclusion list.
	// Services will be reported again if they match patterns.
	RemoveExclusions(serviceNames ...string)
	// DaemonReload reloads systemd daemon configuration.
	DaemonReload(ctx context.Context) error
	// Start starts one or more systemd units.
	Start(ctx context.Context, units ...string) error
	// Stop stops one or more systemd units.
	Stop(ctx context.Context, units ...string) error
	// ResetFailed resets failed state for one or more systemd units.
	ResetFailed(ctx context.Context, units ...string) error
	// ListUnitsByMatchPattern lists systemd units matching the provided patterns.
	ListUnitsByMatchPattern(ctx context.Context, matchPatterns []string) ([]client.SystemDUnitListEntry, error)
	// ListDependencies returns the list of units that the specified unit depends on.
	ListDependencies(ctx context.Context, unit string) ([]string, error)
	// Logs returns the logs based on the specified options
	Logs(ctx context.Context, options ...client.LogOptions) ([]string, error)
	// Show gets information about the specified unit
	Show(ctx context.Context, unit string, options ...client.SystemdShowOptions) ([]string, error)
	status.Exporter
}

func NewManager

func NewManager(log *log.PrefixLogger, client *client.Systemd, journalctl *client.Journalctl) Manager

type ManagerFactory added in v1.1.0

type ManagerFactory func(user v1beta1.Username) (Manager, error)

ManagerFactory creates a systemd manager factory. A blank user means to use the same process user.

func NewManagerFactory added in v1.1.0

func NewManagerFactory(log *log.PrefixLogger) ManagerFactory

type MockManager added in v0.5.0

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

MockManager is a mock of Manager interface.

func NewMockManager added in v0.5.0

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) AddExclusions added in v1.0.0

func (m *MockManager) AddExclusions(serviceNames ...string)

AddExclusions mocks base method.

func (*MockManager) DaemonReload added in v1.0.0

func (m *MockManager) DaemonReload(ctx context.Context) error

DaemonReload mocks base method.

func (*MockManager) EXPECT added in v0.5.0

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) EnsurePatterns added in v0.5.0

func (m *MockManager) EnsurePatterns(arg0 []string) error

EnsurePatterns mocks base method.

func (*MockManager) ListDependencies added in v1.0.0

func (m *MockManager) ListDependencies(ctx context.Context, unit string) ([]string, error)

ListDependencies mocks base method.

func (*MockManager) ListUnitsByMatchPattern added in v1.0.0

func (m *MockManager) ListUnitsByMatchPattern(ctx context.Context, matchPatterns []string) ([]client.SystemDUnitListEntry, error)

ListUnitsByMatchPattern mocks base method.

func (*MockManager) Logs added in v1.0.0

func (m *MockManager) Logs(ctx context.Context, options ...client.LogOptions) ([]string, error)

Logs mocks base method.

func (*MockManager) RemoveExclusions added in v1.0.0

func (m *MockManager) RemoveExclusions(serviceNames ...string)

RemoveExclusions mocks base method.

func (*MockManager) ResetFailed added in v1.0.0

func (m *MockManager) ResetFailed(ctx context.Context, units ...string) error

ResetFailed mocks base method.

func (*MockManager) Show added in v1.0.0

func (m *MockManager) Show(ctx context.Context, unit string, options ...client.SystemdShowOptions) ([]string, error)

Show mocks base method.

func (*MockManager) Start added in v1.0.0

func (m *MockManager) Start(ctx context.Context, units ...string) error

Start mocks base method.

func (*MockManager) Status added in v0.5.0

func (m *MockManager) Status(arg0 context.Context, arg1 *v1beta1.DeviceStatus, arg2 ...status.CollectorOpt) error

Status mocks base method.

func (*MockManager) Stop added in v1.0.0

func (m *MockManager) Stop(ctx context.Context, units ...string) error

Stop mocks base method.

type MockManagerMockRecorder added in v0.5.0

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) AddExclusions added in v1.0.0

func (mr *MockManagerMockRecorder) AddExclusions(serviceNames ...any) *gomock.Call

AddExclusions indicates an expected call of AddExclusions.

func (*MockManagerMockRecorder) DaemonReload added in v1.0.0

func (mr *MockManagerMockRecorder) DaemonReload(ctx any) *gomock.Call

DaemonReload indicates an expected call of DaemonReload.

func (*MockManagerMockRecorder) EnsurePatterns added in v0.5.0

func (mr *MockManagerMockRecorder) EnsurePatterns(arg0 any) *gomock.Call

EnsurePatterns indicates an expected call of EnsurePatterns.

func (*MockManagerMockRecorder) ListDependencies added in v1.0.0

func (mr *MockManagerMockRecorder) ListDependencies(ctx, unit any) *gomock.Call

ListDependencies indicates an expected call of ListDependencies.

func (*MockManagerMockRecorder) ListUnitsByMatchPattern added in v1.0.0

func (mr *MockManagerMockRecorder) ListUnitsByMatchPattern(ctx, matchPatterns any) *gomock.Call

ListUnitsByMatchPattern indicates an expected call of ListUnitsByMatchPattern.

func (*MockManagerMockRecorder) Logs added in v1.0.0

func (mr *MockManagerMockRecorder) Logs(ctx any, options ...any) *gomock.Call

Logs indicates an expected call of Logs.

func (*MockManagerMockRecorder) RemoveExclusions added in v1.0.0

func (mr *MockManagerMockRecorder) RemoveExclusions(serviceNames ...any) *gomock.Call

RemoveExclusions indicates an expected call of RemoveExclusions.

func (*MockManagerMockRecorder) ResetFailed added in v1.0.0

func (mr *MockManagerMockRecorder) ResetFailed(ctx any, units ...any) *gomock.Call

ResetFailed indicates an expected call of ResetFailed.

func (*MockManagerMockRecorder) Show added in v1.0.0

func (mr *MockManagerMockRecorder) Show(ctx, unit any, options ...any) *gomock.Call

Show indicates an expected call of Show.

func (*MockManagerMockRecorder) Start added in v1.0.0

func (mr *MockManagerMockRecorder) Start(ctx any, units ...any) *gomock.Call

Start indicates an expected call of Start.

func (*MockManagerMockRecorder) Status added in v0.5.0

func (mr *MockManagerMockRecorder) Status(arg0, arg1 any, arg2 ...any) *gomock.Call

Status indicates an expected call of Status.

func (*MockManagerMockRecorder) Stop added in v1.0.0

func (mr *MockManagerMockRecorder) Stop(ctx any, units ...any) *gomock.Call

Stop indicates an expected call of Stop.

Jump to

Keyboard shortcuts

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