settings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package settings provides the ability to read, write, decode and encode the binary data of DefaultConnectionSettings from the Windows registry.

Index

Constants

View Source
const (
	FlagDirect       = 1 << iota
	FlagProxy        // use an explicitly set proxy server
	FlagAutoProxyURL // use an automatic configuration script downloaded from a specified URL
	FlagAutoDetect   // automatically detect settings
)
View Source
const (
	RegistryKeyPath   = `SOFTWARE\Microsoft\Windows\CurrentVersion\Internet settings\Connections`
	RegistryValueName = "DefaultConnectionSettings"
)

Variables

This section is empty.

Functions

func ReadBinary

func ReadBinary() ([]byte, error)

ReadBinary reads the binary data of DefaultConnectionSettings from the registry.

func Write

func Write(settings *DefaultConnectionSettings) error

Write encodes and writes the binary data of DefaultConnectionSettings to the registry.

func WriteBinary

func WriteBinary(data []byte) error

WriteBinary writes the binary data of DefaultConnectionSettings to the registry.

Types

type DefaultConnectionSettings

type DefaultConnectionSettings struct {
	Unknown       int32    `json:"unknown"`
	Version       int32    `json:"version"`
	Flags         int32    `json:"flags"`
	ProxyAddress  string   `json:"proxy_address"`
	BypassList    string   `json:"bypass_list"`
	ScriptAddress string   `json:"script_address"`
	UnKnown1      [32]byte `json:"unknown1"`
}

DefaultConnectionSettings is the struct representation of its registry value.

func New

New returns a new DefaultConnectionSettings with Unknown set to 70 and Flags set to FlagDirect.

func Read

Read reads and decodes the binary data of DefaultConnectionSettings from the registry.

func (*DefaultConnectionSettings) MarshalBinary

func (settings *DefaultConnectionSettings) MarshalBinary() (data []byte, err error)

MarshalBinary encodes itself into a binary form and returns the result.

func (*DefaultConnectionSettings) UnmarshalBinary

func (settings *DefaultConnectionSettings) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary decodes the binary data from the registry.

Jump to

Keyboard shortcuts

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