Documentation
¶
Index ¶
- Constants
- Variables
- func ClearAuthCfgForTesting()
- func SetAuthCfgForTesting(auth Auth)
- type Audio
- type Auth
- type CredentialEntry
- type DriverConfig
- type Groovy
- type Instance
- func (c *Instance) APIPort() int
- func (c *Instance) AllowedOrigins() []string
- func (c *Instance) AudioFeedback() bool
- func (c *Instance) AutoDetect() bool
- func (c *Instance) CustomLaunchers() []LaunchersCustom
- func (c *Instance) DebugLogging() bool
- func (c *Instance) DefaultMediaDir() string
- func (c *Instance) GmcProxyBeaconInterval() string
- func (c *Instance) GmcProxyEnabled() bool
- func (c *Instance) GmcProxyPort() int
- func (c *Instance) HoldModeEnabled() bool
- func (c *Instance) IndexRoots() []string
- func (c *Instance) IsDriverAutoDetectEnabled(driverID string, defaultAutoDetect bool) bool
- func (c *Instance) IsDriverEnabled(driverID string, defaultEnabled bool) bool
- func (c *Instance) IsExecuteAllowed(s string) bool
- func (c *Instance) IsHoldModeIgnoredSystem(systemID string) bool
- func (c *Instance) IsLauncherFileAllowed(s string) bool
- func (c *Instance) IsRunAllowed(s string) bool
- func (c *Instance) LaunchersOnMediaStart() string
- func (c *Instance) Load() error
- func (c *Instance) LoadCustomLaunchers(launchersDir string) error
- func (c *Instance) LoadMappings(mappingsDir string) error
- func (c *Instance) LookupLauncherDefaults(launcherID string) (LaunchersDefault, bool)
- func (c *Instance) LookupSystemDefaults(systemID string) (SystemsDefault, bool)
- func (c *Instance) Mappings() []MappingsEntry
- func (c *Instance) Readers() Readers
- func (c *Instance) ReadersScan() ReadersScan
- func (c *Instance) Save() error
- func (c *Instance) SetAudioFeedback(enabled bool)
- func (c *Instance) SetAutoDetect(enabled bool)
- func (c *Instance) SetDebugLogging(enabled bool)
- func (c *Instance) SetReaderConnections(rcs []ReadersConnect)
- func (c *Instance) SetScanExitDelay(exitDelay float32)
- func (c *Instance) SetScanIgnoreSystem(ignoreSystem []string)
- func (c *Instance) SetScanMode(mode string)
- func (c *Instance) SystemDefaults() []SystemsDefault
- func (c *Instance) TapModeEnabled() bool
- type Launchers
- type LaunchersCustom
- type LaunchersDefault
- type Mappings
- type MappingsEntry
- type Readers
- type ReadersConnect
- type ReadersScan
- type Service
- type Systems
- type SystemsDefault
- type Values
- type ZapScript
Constants ¶
View Source
const ( AppName = "zaparoo" MediaDbFile = "media.db" UserDbFile = "user.db" LogFile = "core.log" PidFile = "core.pid" CfgFile = "config.toml" AuthFile = "auth.toml" UserDir = "user" APIRequestTimeout = 30 * time.Second SuccessSoundFilename = "success.wav" FailSoundFilename = "fail.wav" AssetsDir = "assets" MappingsDir = "mappings" LaunchersDir = "launchers" MediaDir = "media" )
View Source
const ( SchemaVersion = 1 CfgEnv = "ZAPAROO_CFG" AppEnv = "ZAPAROO_APP" ScanModeTap = "tap" ScanModeHold = "hold" )
Variables ¶
View Source
var AppVersion = "DEVELOPMENT"
View Source
var BaseDefaults = Values{ ConfigSchema: SchemaVersion, Audio: Audio{ ScanFeedback: true, }, Readers: Readers{ AutoDetect: true, Scan: ReadersScan{ Mode: ScanModeTap, }, }, Service: Service{ APIPort: 7497, }, Groovy: Groovy{ GmcProxyEnabled: false, GmcProxyPort: 32106, GmcProxyBeaconInterval: "2s", }, }
Functions ¶
func ClearAuthCfgForTesting ¶
func ClearAuthCfgForTesting()
ClearAuthCfgForTesting clears the global auth config for testing purposes
func SetAuthCfgForTesting ¶
func SetAuthCfgForTesting(auth Auth)
SetAuthCfgForTesting sets the global auth config for testing purposes
Types ¶
type Auth ¶
type Auth struct {
Creds map[string]CredentialEntry `toml:"creds,omitempty"`
}
func GetAuthCfg ¶
func GetAuthCfg() Auth
type CredentialEntry ¶
type CredentialEntry struct {
Username string `toml:"username"`
Password string `toml:"password"`
Bearer string `toml:"bearer"`
}
func LookupAuth ¶
func LookupAuth(authCfg Auth, reqURL string) *CredentialEntry
type DriverConfig ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) AllowedOrigins ¶
func (*Instance) AudioFeedback ¶
func (*Instance) AutoDetect ¶
func (*Instance) CustomLaunchers ¶
func (c *Instance) CustomLaunchers() []LaunchersCustom
func (*Instance) DebugLogging ¶
func (*Instance) DefaultMediaDir ¶
func (*Instance) GmcProxyBeaconInterval ¶
func (*Instance) GmcProxyEnabled ¶
func (*Instance) GmcProxyPort ¶
func (*Instance) HoldModeEnabled ¶
func (*Instance) IndexRoots ¶
func (*Instance) IsDriverAutoDetectEnabled ¶
func (*Instance) IsDriverEnabled ¶
func (*Instance) IsExecuteAllowed ¶
func (*Instance) IsHoldModeIgnoredSystem ¶
func (*Instance) IsLauncherFileAllowed ¶
func (*Instance) IsRunAllowed ¶
func (*Instance) LaunchersOnMediaStart ¶
func (*Instance) LoadCustomLaunchers ¶
func (*Instance) LoadMappings ¶
func (*Instance) LookupLauncherDefaults ¶
func (c *Instance) LookupLauncherDefaults(launcherID string) (LaunchersDefault, bool)
func (*Instance) LookupSystemDefaults ¶
func (c *Instance) LookupSystemDefaults(systemID string) (SystemsDefault, bool)
func (*Instance) Mappings ¶
func (c *Instance) Mappings() []MappingsEntry
func (*Instance) ReadersScan ¶
func (c *Instance) ReadersScan() ReadersScan
func (*Instance) SetAudioFeedback ¶
func (*Instance) SetAutoDetect ¶
func (*Instance) SetDebugLogging ¶
func (*Instance) SetReaderConnections ¶
func (c *Instance) SetReaderConnections(rcs []ReadersConnect)
func (*Instance) SetScanExitDelay ¶
func (*Instance) SetScanIgnoreSystem ¶
func (*Instance) SetScanMode ¶
func (*Instance) SystemDefaults ¶
func (c *Instance) SystemDefaults() []SystemsDefault
func (*Instance) TapModeEnabled ¶
type Launchers ¶
type Launchers struct {
IndexRoot []string `toml:"index_root,omitempty,multiline"`
AllowFile []string `toml:"allow_file,omitempty,multiline"`
MediaDir string `toml:"media_dir,omitempty"`
OnMediaStart string `toml:"on_media_start,omitempty"`
Default []LaunchersDefault `toml:"default,omitempty"`
Custom []LaunchersCustom `toml:"custom,omitempty"`
// contains filtered or unexported fields
}
type LaunchersCustom ¶
type LaunchersDefault ¶
type Mappings ¶
type Mappings struct {
Entry []MappingsEntry `toml:"entry,omitempty"`
}
type MappingsEntry ¶
type Readers ¶
type Readers struct {
Drivers map[string]DriverConfig `toml:"drivers,omitempty"`
Connect []ReadersConnect `toml:"connect,omitempty"`
Scan ReadersScan `toml:"scan,omitempty"`
AutoDetect bool `toml:"auto_detect"`
}
type ReadersConnect ¶
type ReadersConnect struct {
Driver string `toml:"driver"`
Path string `toml:"path,omitempty"`
IDSource string `toml:"id_source,omitempty"`
}
func (ReadersConnect) ConnectionString ¶
func (r ReadersConnect) ConnectionString() string
type ReadersScan ¶
type Systems ¶
type Systems struct {
Default []SystemsDefault `toml:"default,omitempty"`
}
type SystemsDefault ¶
type Values ¶
type Values struct {
Launchers Launchers `toml:"launchers,omitempty"`
ZapScript ZapScript `toml:"zapscript,omitempty"`
Systems Systems `toml:"systems,omitempty"`
Mappings Mappings `toml:"mappings,omitempty"`
Service Service `toml:"service,omitempty"`
Groovy Groovy `toml:"groovy,omitempty"`
Readers Readers `toml:"readers,omitempty"`
ConfigSchema int `toml:"config_schema"`
Audio Audio `toml:"audio,omitempty"`
DebugLogging bool `toml:"debug_logging"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.