system

package
v0.11.2 Latest Latest
Warning

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

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

Documentation

Overview

Package system is a generated GoMock package.

Index

Constants

View Source
const ScopeName = "github.com/kofuk/premises/runner/internal/system"

Variables

This section is empty.

Functions

func AptGet

func AptGet(ctx context.Context, args ...string) error

func GetAppUserID

func GetAppUserID() (int, int, error)

func GetHostOS

func GetHostOS() (string, error)

func GetTotalMemory

func GetTotalMemory() (int, error)

func RunWithOutput added in v0.7.0

func RunWithOutput(ctx context.Context, executor CommandExecutor, path string, args []string, options ...CmdOption) (string, error)

Types

type CPUUsage

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

func NewCPUUsage

func NewCPUUsage() (*CPUUsage, error)

func (*CPUUsage) Percent

func (c *CPUUsage) Percent() (float64, error)

type CmdOption

type CmdOption func(cmd *exec.Cmd)

func WithEnv

func WithEnv(env string) CmdOption

func WithOutput added in v0.7.0

func WithOutput(w io.Writer) CmdOption

func WithWorkingDir

func WithWorkingDir(dir string) CmdOption

type CommandExecutor added in v0.7.0

type CommandExecutor interface {
	Run(ctx context.Context, path string, args []string, options ...CmdOption) error
}
var DefaultExecutor CommandExecutor = new(SimpleExecutor)

type MockCommandExecutor added in v0.7.0

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

MockCommandExecutor is a mock of CommandExecutor interface.

func NewMockCommandExecutor added in v0.7.0

func NewMockCommandExecutor(ctrl *gomock.Controller) *MockCommandExecutor

NewMockCommandExecutor creates a new mock instance.

func (*MockCommandExecutor) EXPECT added in v0.7.0

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

func (*MockCommandExecutor) Run added in v0.7.0

func (m *MockCommandExecutor) Run(ctx context.Context, path string, args []string, options ...CmdOption) error

Run mocks base method.

type MockCommandExecutorMockRecorder added in v0.7.0

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

MockCommandExecutorMockRecorder is the mock recorder for MockCommandExecutor.

func (*MockCommandExecutorMockRecorder) Run added in v0.7.0

func (mr *MockCommandExecutorMockRecorder) Run(ctx, path, args any, options ...any) *gomock.Call

Run indicates an expected call of Run.

type SimpleExecutor added in v0.7.0

type SimpleExecutor struct{}

func (*SimpleExecutor) Run added in v0.7.0

func (e *SimpleExecutor) Run(ctx context.Context, path string, args []string, options ...CmdOption) error

type SystemInfo

type SystemInfo struct {
	PremisesVersion string `json:"premisesVersion"`
	HostOS          string `json:"hostOS"`
}

func GetSystemVersion

func GetSystemVersion() *SystemInfo

Jump to

Keyboard shortcuts

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