config

package
v0.0.0-...-927397c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveControllerConfig

func SaveControllerConfig(configPath string, cfg *ControllerConfig, overwrite bool) error

SaveControllerConfig writes the ControllerConfig for a controller with the given name under the configPath directory. An error is returned if a config for the controller already exists unless the overwrite flag is set.

func WriteConfig

func WriteConfig(path string, data []byte) error

WriteConfig writes data to path but first writes it to a temporary file to avoid errors where the write fails & the data from the original config is lost.

Types

type AccessoryPairing

type AccessoryPairing struct {
	Name             string
	DeviceName       string
	Model            string
	DeviceID         string
	PublicKey        []byte
	IPConnectionInfo client.IPConnectionInfo
}

AccessoryPairing details a paired accessory

type ControllerConfig

type ControllerConfig struct {
	Name              string
	DeviceID          string
	PublicKey         []byte
	PrivateKey        []byte
	AccessoryPairings []*AccessoryPairing
}

ControllerConfig details a controller and its pairings

func ReadControllerConfig

func ReadControllerConfig(configPath string, name string) (*ControllerConfig, error)

ReadControllerConfig reads the ControllerConfig for a controller with the given name stored under the configPath directory

Jump to

Keyboard shortcuts

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