conf

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPath = "/etc/wpa_supplicant/wpa_supplicant.conf"

DefaultPath is the default path for WPA supplicant config file

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Preamble []string
	Networks []Network
	// contains filtered or unexported fields
}

File represents the config file

func Open

func Open(path string) (*File, error)

Open will open and parse the config file at the given path

func (*File) Load

func (f *File) Load() error

Load will parse the file contents into Preamble and Networks

func (*File) Path

func (f *File) Path() string

Path will return the path of the file

func (*File) Save

func (f *File) Save() error

Save will save the config to the file path

type Network

type Network struct {
	wireless.Network
}

Network models a network in a WPA config file

func NewNetworkFromLines

func NewNetworkFromLines(id int, lines []string) Network

NewNetworkFromLines will parse the lines from a network block and turn them into a network object

func (Network) Render

func (net Network) Render() string

Render will render the network as a network block in the config file

Jump to

Keyboard shortcuts

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