ostuning

package
v3.3.130 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ProfileHighThroughputUpload = "high-throughput-upload"

Variables

This section is empty.

Functions

func CurrentProcessElevated

func CurrentProcessElevated() bool

func SplitStepsByElevation

func SplitStepsByElevation(steps []Step, elevated bool) (runnable []Step, skipped []Step)

func StepRequiresElevation

func StepRequiresElevation(step Step) bool

func SupportedOS

func SupportedOS() []string

Types

type Command

type Command struct {
	Shell       Shell
	CommandLine string
}

func CommandsForSteps

func CommandsForSteps(steps []Step) []Command

type CommandResult

type CommandResult struct {
	Command Command
	DryRun  bool
	Err     error
}

func RunCommands

func RunCommands(ctx context.Context, commands []Command, options RunOptions) []CommandResult

type Options

type Options struct {
	OS                 string
	InterfaceName      string
	IncludeNetworkTest bool
}

type Plan

type Plan struct {
	OS            string
	Profile       string
	InterfaceName string
	SnapshotPath  string
	Summary       string
	UserSteps     []Step
	NetworkTests  []Step
	SnapshotSteps []Step
	AdminSteps    []Step
	RestoreSteps  []Step
	Warnings      []string
	Notes         []string
	References    []Reference
}

func HighThroughputUploadPlan

func HighThroughputUploadPlan(options Options) (Plan, error)

func (Plan) RepairChangeSteps

func (p Plan) RepairChangeSteps() []Step

func (Plan) RepairPostChangeSteps

func (p Plan) RepairPostChangeSteps() []Step

func (Plan) RepairPreflightSteps

func (p Plan) RepairPreflightSteps() []Step

func (Plan) RepairSteps

func (p Plan) RepairSteps() []Step

func (Plan) RestorePlanSteps

func (p Plan) RestorePlanSteps() []Step

func (Plan) Steps

func (p Plan) Steps() []Step

func (Plan) VerificationSteps

func (p Plan) VerificationSteps() []Step

type Privilege

type Privilege string
const (
	PrivilegeUser          Privilege = "user"
	PrivilegeAdministrator Privilege = "administrator"
)

type Reference

type Reference struct {
	Title string
	URL   string
}

type RunOptions

type RunOptions struct {
	Stdout        io.Writer
	Stderr        io.Writer
	DryRun        bool
	StopOnError   bool
	BeforeStep    func(Step)
	BeforeCommand func(Command)
}

type Shell

type Shell string
const (
	ShellPOSIX      Shell = "posix"
	ShellPowerShell Shell = "powershell"
	ShellCommand    Shell = "cmd"
)

type Step

type Step struct {
	ID              string
	Title           string
	Description     string
	Privilege       Privilege
	Commands        []Command
	Verification    []Command
	RequiresReboot  bool
	RuntimeOnly     bool
	CanFailSoftly   bool
	ExpectedOutcome string
}

type StepResult

type StepResult struct {
	Step                Step
	CommandResults      []CommandResult
	SkippedForPrivilege bool
	Err                 error
	SoftFailed          bool
}

func RunSteps

func RunSteps(ctx context.Context, steps []Step, options RunOptions) []StepResult

func RunStepsWithElevation

func RunStepsWithElevation(ctx context.Context, steps []Step, elevated bool, options RunOptions) []StepResult

Jump to

Keyboard shortcuts

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