ostuning

package
v3.3.193 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 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

Index

Constants

View Source
const (
	// MinimumOpenFileLimit is the lowest soft nofile value OS tuning treats as
	// acceptable for high-throughput adaptive uploads.
	MinimumOpenFileLimit = 8192
	// PreferredOpenFileLimit is the recommended soft nofile value for hosts
	// dedicated to high-throughput transfer workloads.
	PreferredOpenFileLimit = 65536
)
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 OpenFileLimitResult added in v3.3.131

type OpenFileLimitResult struct {
	Supported  bool
	BeforeSoft uint64
	BeforeHard uint64
	AfterSoft  uint64
	Changed    bool
}

func RaiseCurrentProcessOpenFileLimit added in v3.3.131

func RaiseCurrentProcessOpenFileLimit() (OpenFileLimitResult, error)

RaiseCurrentProcessOpenFileLimit raises the current process soft nofile limit to the preferred high-throughput limit when the platform supports POSIX resource limits.

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