Documentation ¶
Index ¶
- Constants
- func VmcLock(ctx context.Context)
- func VmcUnLock(ctx context.Context)
- type Config
- type ConfigSource
- type DeviceConfig
- type FullReader
- type Global
- func (g *Global) Broken()
- func (g *Global) CheckDevices() error
- func (g *Global) ClientBegin(ctx context.Context)
- func (g *Global) ClientEnd(ctx context.Context)
- func (g *Global) Display() (*display.Display, error)
- func (g *Global) Error(err error, args ...interface{})
- func (g *Global) Fatal(err error, args ...interface{})
- func (g *Global) GetDevice(name string) (types.Devicer, error)
- func (g *Global) GetDeviceConfig(name string) (DeviceConfig, error)
- func (g *Global) Init(ctx context.Context, cfg *Config) error
- func (g *Global) Iodin() (*iodin.Client, error)
- func (g *Global) Mdb() (*mdb.Bus, error)
- func (g *Global) Mega() (*mega.Client, error)
- func (g *Global) MustInit(ctx context.Context, cfg *Config)
- func (g *Global) MustTextDisplay() *text_display.TextDisplay
- func (g *Global) RegisterCommands(ctx context.Context)
- func (g *Global) RegisterDevice(name string, dev types.Devicer, probe func() error) error
- func (g *Global) RunBashSript(script string) (err error)
- func (g *Global) ScheduleSync(ctx context.Context, fun types.TaskFunc) error
- func (g *Global) ShowPicture(pict Pic)
- func (g *Global) ShowQR(t string)
- func (g *Global) Stop()
- func (g *Global) StopWait(timeout time.Duration) bool
- func (g *Global) TextDisplay() (*text_display.TextDisplay, error)
- func (g *Global) UI() types.UIer
- func (g *Global) UpgradeVender()
- func (g *Global) VmcStop(ctx context.Context)
- func (g *Global) VmcStopWOInitRequared(ctx context.Context)
- type MockFullReader
- type OsFullReader
- type Pic
Constants ¶
View Source
const ContextKey = "run/state-global"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // only used for Unmarshal, do not access XXX_Include []ConfigSource `hcl:"include"` UpgradeScript string `hcl:"upgrade_script"` ScriptIfBroken string `hcl:"script_if_broken"` Debug struct { PprofListen string `hcl:"pprof_listen"` } Hardware struct { // only used for Unmarshal, do not access XXX_Devices []DeviceConfig `hcl:"device"` Evend evend_config.Config `hcl:"evend"` Display struct { Framebuffer string `hcl:"framebuffer"` } HD44780 struct { Enable bool `hcl:"enable"` Codepage string `hcl:"codepage"` PinChip string `hcl:"pin_chip"` Pinmap hd44780.PinMap `hcl:"pinmap"` Page1 bool `hcl:"page1"` Width int `hcl:"width"` ControlBlink bool `hcl:"blink"` ControlCursor bool `hcl:"cursor"` ScrollDelay int `hcl:"scroll_delay"` } IodinPath string `hcl:"iodin_path"` Input struct { EvendKeyboard struct { Enable bool `hcl:"enable"` } `hcl:"evend_keyboard"` DevInputEvent struct { Enable bool `hcl:"enable"` Device string `hcl:"device"` } `hcl:"dev_input_event"` } Mdb mdb_config.Config `hcl:"mdb"` Mega struct { LogDebug bool `hcl:"log_debug"` Spi string `hcl:"spi"` SpiSpeed string `hcl:"spi_speed"` PinChip string `hcl:"pin_chip"` Pin string `hcl:"pin"` } } Engine engine_config.Config Money struct { Scale int `hcl:"scale"` CreditMax int `hcl:"credit_max"` EnableChangeBillToCoin bool `hcl:"enable_change_bill_to_coin"` ChangeOverCompensate int `hcl:"change_over_compensate"` } Persist struct { Root string `hcl:"root"` } Tele tele_config.Config UI ui_config.Config Sound sound.Config Watchdog watchdog.Config // contains filtered or unexported fields }
func MustReadConfig ¶
func MustReadConfig(log *log2.Log, fs FullReader, names ...string) *Config
func ReadConfig ¶
type ConfigSource ¶
type DeviceConfig ¶
type FullReader ¶
type Global ¶
type Global struct { Alive *alive.Alive BuildVersion string Config *Config Engine *engine.Engine Hardware hardware // hardware.go Inventory *inventory.Inventory Log *log2.Log Tele tele_api.Teler LockCh chan struct{} XXX_money atomic.Value // *money.MoneySystem crutch to import cycle XXX_uier atomic.Value // UIer crutch to import/init cycle }
func (*Global) CheckDevices ¶
func (*Global) ClientBegin ¶
func (*Global) GetDeviceConfig ¶
func (g *Global) GetDeviceConfig(name string) (DeviceConfig, error)
func (*Global) MustTextDisplay ¶
func (g *Global) MustTextDisplay() *text_display.TextDisplay
func (*Global) RegisterCommands ¶
func (*Global) RegisterDevice ¶
Drivers call RegisterDevice to declare device support. probe is called only for devices enabled in config.
func (*Global) RunBashSript ¶ added in v0.240119.0
func (*Global) ScheduleSync ¶
func (*Global) ShowPicture ¶ added in v0.220206.0
func (*Global) TextDisplay ¶
func (g *Global) TextDisplay() (*text_display.TextDisplay, error)
func (*Global) UpgradeVender ¶ added in v0.221212.0
func (g *Global) UpgradeVender()
func (*Global) VmcStopWOInitRequared ¶ added in v0.221220.0
type MockFullReader ¶
func NewMockFullReader ¶
func NewMockFullReader(sources map[string]string) *MockFullReader
func (*MockFullReader) Normalize ¶
func (ofr *MockFullReader) Normalize(name string) string
type OsFullReader ¶
type OsFullReader struct {
// contains filtered or unexported fields
}
func NewOsFullReader ¶
func NewOsFullReader() *OsFullReader
func (OsFullReader) Normalize ¶
func (ofr OsFullReader) Normalize(path string) string
func (*OsFullReader) SetBase ¶
func (ofr *OsFullReader) SetBase(path string)
Click to show internal directories.
Click to hide internal directories.