system

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package system provides OS-level proxy configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallCA

func InstallCA(certPath, certName string) error

InstallCA is a convenience function to install a CA certificate.

func SetSystemProxy

func SetSystemProxy(host string, port int) error

SetSystemProxy is a convenience function to set the system proxy.

func UninstallCA

func UninstallCA(certName string) error

UninstallCA is a convenience function to uninstall a CA certificate.

func UnsetSystemProxy

func UnsetSystemProxy() error

UnsetSystemProxy is a convenience function to unset the system proxy.

Types

type ProxyConfig

type ProxyConfig struct {
	HTTPProxy  string
	HTTPSProxy string
	Host       string
	Port       int
	Enabled    bool
}

ProxyConfig represents proxy configuration settings.

type SystemProxy

type SystemProxy interface {
	// Name returns the OS name
	Name() string

	// SetProxy configures the system to use a proxy
	SetProxy(host string, port int) error

	// UnsetProxy removes the system proxy configuration
	UnsetProxy() error

	// GetProxy returns the current proxy configuration
	GetProxy() (*ProxyConfig, error)

	// InstallCA installs a CA certificate into the system trust store
	InstallCA(certPath string, certName string) error

	// UninstallCA removes a CA certificate from the system trust store
	UninstallCA(certName string) error

	// IsCAInstalled checks if a CA certificate is installed
	IsCAInstalled(certName string) (bool, error)
}

SystemProxy provides an interface for OS-level proxy configuration.

func New

func New() (SystemProxy, error)

New returns a SystemProxy implementation for the current OS.

Jump to

Keyboard shortcuts

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