Documentation
¶
Overview ¶
Package config provides dex system configuration types and schemas.
Index ¶
Constants ¶
View Source
const DeviceDependency = `` /* 210-byte string literal not displayed */
DeviceDependency is the device serial dependency schema for service validation.
View Source
const ModuleDependency = `
{
module: [_]: {
...
}
#Module: or([for k, v in module{k}])
service: [_]: {
module?: #Module
...
}
}
`
ModuleDependency is the module dependency schema for service and module validation.
View Source
const Schema = `` /* 1550-byte string literal not displayed */
Schema is the schema for a valid configuration.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Button ¶
type Button struct {
Row int `json:"row" toml:"row"`
Col int `json:"col" toml:"col"`
Page string `json:"page,omitempty" toml:"page"`
Change *string `json:"change,omitempty" toml:"change"`
Do *string `json:"do,omitempty" toml:"do"`
Args any `json:"args,omitempty" toml:"args"`
Image string `json:"image,omitempty" toml:"image"`
}
Button indicates actions associated with a button location and state change.
type Device ¶
type Device struct {
// PID is the product ID of the device.
PID ardilla.PID `json:"pid,omitempty" toml:"pid"`
// Serial is the device serial numbers.
Serial *string `json:"serial,omitempty" toml:"serial"`
// Default is the default page name for the device.
// If Default is nil, the device default name is used.
Default *string `json:"default,omitempty" toml:"default"`
// Required indicates the configuration may not
// continue if the device is not available.
Required bool `json:"required,omitempty" toml:"required"`
}
type Kernel ¶
type Kernel struct {
// Device is the set of physical devices the kernel is handling.
// If Device is [{0, ""}], it is handling the first available device.
Device []Device `json:"device,omitempty" toml:"device"`
// Missing is the list of devices that are not required and are
// not present.
Missing []string `json:"missing,omitempty"`
// Network is the network the kernel is communicating on.
Network string `json:"network,omitempty" toml:"network"`
LogLevel *slog.Level `json:"log_level,omitempty" toml:"log_level"`
AddSource *bool `json:"log_add_source,omitempty" toml:"log_add_source"`
// Options is a bag of arbitrary configuration values.
// See Schema for valid entries.
Options map[string]any `json:"options,omitempty" toml:"options"`
Sum *Sum `json:"sum,omitempty"`
Err error `json:"err,omitempty"`
}
Kernel is the kernel configuration.
type Module ¶
type Module struct {
// Path is the path to the module's executable.
Path string `json:"path,omitempty" toml:"path"`
// Args is any additional arguments pass to the module's
// executable at start up.
Args []string `json:"args,omitempty" toml:"args"`
LogLevel *slog.Level `json:"log_level,omitempty" toml:"log_level"`
AddSource *bool `json:"log_add_source,omitempty" toml:"log_add_source"`
// LogMode specifies how module logging is handled
// by the system; options are "log", "passthrough"
// and "none". The default behaviour is "passthrough".
// Modules must support the -log_stdout flag to use
// the "log" option. This flag will be added if not
// already included in Args.
//
// log: stdout → stderr
// stderr → capture and log via system logger
//
// passthrough: stdout → stdout
// stderr → stderr
//
// none: stdout → /dev/null
// stderr → /dev/null
//
LogMode string `json:"log_mode,omitempty" toml:"log_mode"`
// Options is a bag of arbitrary configuration values.
// Valid values are module-specific.
Options map[string]any `json:"options,omitempty" toml:"options"`
// Schema is the CUE schema for vetting module and services.
// If Schema is empty, DeviceDependency is used.
Schema string `json:"schema,omitempty"`
Sum *Sum `json:"sum,omitempty"`
Err error `json:"err,omitempty"`
}
Module is a module configuration.
type Service ¶
type Service struct {
// Name is used to indicate to a module the service
// to configure in a configure method call.
Name string `json:"name,omitempty"`
// Active indicates the state of the service.
// If a configure call with Active false is made
// the service is deconfigured.
Active *bool `json:"active,omitempty"`
// Module is the module the service depends on.
Module *string `json:"module,omitempty" toml:"module"`
// Serial is the device's serial number the service is using.
// This must correspond to a serial number held by the kernel.
Serial *string `json:"serial,omitempty" toml:"serial"`
// Listen is the set of buttons the service expects to be
// notified of changes in.
Listen []Button `json:"listen,omitempty" toml:"listen"`
// Options is a bag of arbitrary configuration values.
// Valid values are service-specific.
Options map[string]any `json:"options,omitempty" toml:"options"`
Sum *Sum `json:"sum,omitempty"`
Err error `json:"err,omitempty"`
}
Service is a module service configuration.
type Sum ¶
Sum is a comparable optional SHA-1 sum.
func (*Sum) MarshalText ¶
func (*Sum) UnmarshalText ¶
type System ¶
type System struct {
Kernel *Kernel `json:"kernel,omitempty" toml:"kernel"`
Modules map[string]*Module `json:"module,omitempty" toml:"module"`
Services map[string]*Service `json:"service,omitempty" toml:"service"`
Version string `json:"version,omitempty"`
}
System is a complete configuration.
Click to show internal directories.
Click to hide internal directories.