state

package
v0.250118.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: CC0-1.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKey = "run/state-global"

Variables

This section is empty.

Functions

This section is empty.

Types

type FullReader

type FullReader interface {
	Normalize(key string) string
	// nil,nil = not found
	ReadAll(key string) ([]byte, error)
}

type Global

type Global struct {
	Alive        *alive.Alive
	BuildVersion string
	Config       *config_global.Config
	Engine       *engine.Engine
	Hardware     hardware // hardware.go
	Inventory    *inventory.Inventory
	Log          *log2.Log
	Tele         tele_api.Teler

	XXX_money atomic.Value // *money.MoneySystem crutch to import cycle
	XXX_uier  atomic.Value // UIer crutch to import/init cycle

}

func GetGlobal

func GetGlobal(ctx context.Context) *Global

func (*Global) CheckDevices

func (g *Global) CheckDevices() error

func (*Global) CheckMenuExecution added in v0.241210.0

func (g *Global) CheckMenuExecution()

func (*Global) ClientBegin

func (g *Global) ClientBegin(ctx context.Context)

func (*Global) ClientEnd

func (g *Global) ClientEnd(ctx context.Context)

func (*Global) Display

func (g *Global) Display() (*display.Display, error)

func (*Global) Error

func (g *Global) Error(err error)

func (g *Global) Error(err error, args ...interface{}) {

func (*Global) Fatal

func (g *Global) Fatal(err error)

func (g *Global) Fatal(err error, args ...interface{}) {

func (*Global) GetDevice

func (g *Global) GetDevice(name string) (types.Devicer, error)

Reference registered, inited device

func (*Global) GetDeviceConfig

func (g *Global) GetDeviceConfig(name string) (config_global.DeviceConfig, error)

func (*Global) Init

func (g *Global) Init(ctx context.Context, cfg *config_global.Config) (err error)

func (*Global) Iodin

func (g *Global) Iodin() (*iodin.Client, error)

func (*Global) Mdb

func (g *Global) Mdb() (*mdb.Bus, error)

func (*Global) Mega

func (g *Global) Mega() (*mega.Client, error)

func (*Global) MustTextDisplay

func (g *Global) MustTextDisplay() *text_display.TextDisplay

func (*Global) OrderToMessage added in v0.250107.1

func (g *Global) OrderToMessage() *tele_api.Order

func (*Global) RegisterCommands

func (g *Global) RegisterCommands(ctx context.Context)

func (*Global) RegisterDevice

func (g *Global) RegisterDevice(name string, dev types.Devicer, probe func() error) error

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 (g *Global) RunBashSript(script string) (err error)

func (*Global) ScheduleSync

func (g *Global) ScheduleSync(ctx context.Context, fun types.TaskFunc) error

func (*Global) SendCooking added in v0.250107.1

func (g *Global) SendCooking()

func (*Global) SendNotWork added in v0.250116.0

func (g *Global) SendNotWork(s tele_api.State, errorMessage ...string)

send broken message

func (*Global) ShowQR added in v0.220214.0

func (g *Global) ShowQR(t string)

func (*Global) Stop

func (g *Global) Stop()

func (*Global) StopWait

func (g *Global) StopWait(timeout time.Duration) bool

func (*Global) TextDisplay

func (g *Global) TextDisplay() (*text_display.TextDisplay, error)

func (*Global) UI

func (g *Global) UI() types.UIer

func (*Global) UpgradeVender added in v0.221212.0

func (g *Global) UpgradeVender()

func (*Global) VmcStop

func (g *Global) VmcStop(ctx context.Context, errorMessage ...string)

func (*Global) VmcStopWOInitRequared added in v0.221220.0

func (g *Global) VmcStopWOInitRequared(ctx context.Context, errorMessage ...string)

type MockFullReader

type MockFullReader struct {
	Map map[string]string
}

func NewMockFullReader

func NewMockFullReader(sources map[string]string) *MockFullReader

func (*MockFullReader) Normalize

func (ofr *MockFullReader) Normalize(name string) string

func (*MockFullReader) ReadAll

func (ofr *MockFullReader) ReadAll(name string) ([]byte, error)

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) ReadAll

func (ofr *OsFullReader) ReadAll(path string) ([]byte, error)

func (*OsFullReader) SetBase

func (ofr *OsFullReader) SetBase(path string)

Directories

Path Synopsis
Sorry, workaround to import cycles.
Sorry, workaround to import cycles.

Jump to

Keyboard shortcuts

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