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) CheckDevices() error
- func (g *Global) ClientBegin()
- func (g *Global) ClientEnd()
- 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) ScheduleSync(ctx context.Context, fun types.TaskFunc) error
- 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) VmcStop(ctx context.Context)
- type MockFullReader
- type OsFullReader
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"`
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"`
ChangeOverCompensate int `hcl:"change_over_compensate"`
}
Persist struct {
Root string `hcl:"root"`
}
Tele tele_config.Config
UI ui_config.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{}
TimerUIStop 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 (g *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) ScheduleSync ¶
func (*Global) TextDisplay ¶
func (g *Global) TextDisplay() (*text_display.TextDisplay, error)
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.