Documentation
¶
Index ¶
- Constants
- func ByteToBool(b []byte) bool
- func ByteToInt8(b []byte) int8
- func Log2stdlib(l2 *log2.Log) *log.Logger
- type Config
- type ConfigSource
- type FullReader
- type Global
- func (g *Global) CtlStop(ctx context.Context)
- func (g *Global) Error(err error, args ...interface{})
- func (g *Global) GetRoboState(vmid int32) vender_api.State
- func (g *Global) InitDB(cmdName string) error
- func (g *Global) InitVMC()
- func (g *Global) ItsWaitPayment(p tele_api.Packet) (bool, *tele.Response)
- func (g *Global) ParseFromRobo(p tele_api.Packet) *tele.FromRoboMessage
- func (g *Global) ParseMqttPacket(p tele_api.Packet) *tele.Response
- func (g *Global) RobotConnected(vmid int32) bool
- func (g *Global) SetRoboState(vmid int32, st vender_api.State)
- func (g *Global) VMCErrorWriteDB(vmid int32, vmtime int64, errCode uint32, message string)
- type MockFullReader
- type OsFullReader
Constants ¶
View Source
const ContextKey = "run/state-global"
Variables ¶
This section is empty.
Functions ¶
func ByteToBool ¶
func ByteToInt8 ¶
Types ¶
type Config ¶
type Config struct {
// only used for Unmarshal, do not access
XXX_Include []ConfigSource `hcl:"include"`
DB struct {
PingTimeoutMs int `hcl:"ping_timeout_ms"`
URL string `hcl:"url"`
}
Money struct {
Scale int `hcl:"scale"`
}
Tax struct {
DebugLevel int `hcl:"debug_level"`
Ru2019 struct {
Tag1009 string // payment address
Tag1187 string // payment place
Tag1018 string // business INN
Tag1055 int // uint32 tax form
Tag1199 int // uint32 tax rate
Umka struct {
BaseURL string `hcl:"base_url"`
XXX_testRT http.RoundTripper `hcl:"-"`
}
}
}
CashLess struct {
TerminalKey string
TerminalPass string
QRValidTimeSec int
TerminalQRPayRefreshSec int
TerminalBankCommission int
TerminalMinimalAmount int
URLToListenToBankNotifications string
}
Telegram struct {
TelegrammBotApi string `hcl:"telegram_bot_api"`
TelegramAdmin int64 `hcl:"telegram_admin"`
DebugMessages bool `hcl:"telegram_debug"`
AdminBot string `hcl:"admin_bot_name"`
}
Tele tele_config.Config
// contains filtered or unexported fields
}
func MustReadConfig ¶
func MustReadConfig(log *log2.Log, fs FullReader, names ...string) *Config
func ReadConfig ¶
type ConfigSource ¶
type FullReader ¶
type Global ¶
type Global struct {
Alive *alive.Alive
BuildVersion string
Config *Config
DB *pg.DB
Log *log2.Log
Tele tele_api.Teler
Vmc map[int32]*vmcStruct
}
func (*Global) GetRoboState ¶
func (g *Global) GetRoboState(vmid int32) vender_api.State
func (*Global) ItsWaitPayment ¶
func (*Global) ParseFromRobo ¶
func (g *Global) ParseFromRobo(p tele_api.Packet) *tele.FromRoboMessage
фиксирует подсоединение робота или парсит пакет на команду. fixes the connection of the robot or parses the packet on the command.
func (*Global) ParseMqttPacket ¶
OLD фиксирует подсоединение робота или парсит пакет на команду. fixes the connection of the robot or parses the packet on the command.
func (*Global) RobotConnected ¶
func (*Global) SetRoboState ¶
func (g *Global) SetRoboState(vmid int32, st vender_api.State)
type MockFullReader ¶
func NewMockFullReader ¶
func NewMockFullReader(sources map[string]string) *MockFullReader
func (*MockFullReader) Normalize ¶
func (self *MockFullReader) Normalize(name string) string
type OsFullReader ¶
type OsFullReader struct {
// contains filtered or unexported fields
}
func NewOsFullReader ¶
func NewOsFullReader() *OsFullReader
func (OsFullReader) Normalize ¶
func (self OsFullReader) Normalize(path string) string
func (*OsFullReader) SetBase ¶
func (self *OsFullReader) SetBase(path string)
Click to show internal directories.
Click to hide internal directories.