config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeBoth  deviceMode = "both"
	ModeDark  deviceMode = "dark"
	ModeLight deviceMode = "light"
)

ModeBoth is set if the device should start both light and dark modes ModeDark if the device should start in dark mode ModeLight if the device should start in light mode

Variables

View Source
var (
	AllModes  = []string{ModeDark.String(), ModeLight.String(), ModeBoth.String()}
	BothModes = []string{ModeDark.String(), ModeLight.String()}
)

AllModes stores all the valid modes: light, dark, both BothModes stores the meaning of both modes: light, dark

Functions

This section is empty.

Types

type Data

type Data struct {
	Cmd     string  `yaml:"command"`
	Devices Devices `yaml:"devices"`
}

Data is the highest level of the configuration contains the command for execution and the devices for run. More details is under Devices

func Read

func Read(configName string, isMac bool) (Data, error)

Read is reading the screenshots.yaml file and returning the parsed config.Data

type Device

type Device struct {
	Name string `yaml:"name"`
	Mode string `yaml:"mode"` // can be dark, light, both
}

Device represents the possible configuration properties of a device

type Devices

type Devices struct {
	IOS     []Device `yaml:"ios"`
	Android []Device `yaml:"android"`
}

Devices is wrapping all IOS and Android devices in two separate lists

Jump to

Keyboard shortcuts

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