engine_config

package
v0.211016.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	Name     string `hcl:"name,key"`
	Scenario string `hcl:"scenario"`

	Doer engine.Doer `hcl:"-"`
}

type Config

type Config struct {
	Aliases        []Alias  `hcl:"alias"`
	OnBoot         []string `hcl:"on_boot"`
	OnMenuError    []string `hcl:"on_menu_error"`
	OnServiceBegin []string `hcl:"on_service_begin"`
	OnServiceEnd   []string `hcl:"on_service_end"`
	OnFrontBegin   []string `hcl:"on_front_begin"`
	OnBroken       []string `hcl:"on_broken"`
	Inventory      Inventory
	Menu           struct {
		Items []*MenuItem `hcl:"item"`
	}
	Profile struct {
		Regexp      string `hcl:"regexp"`
		MinUs       int    `hcl:"min_us"`
		LogFormat   string `hcl:"log_format"`
		StateScript string `hcl:"state_script"` // env ${data}, ${state} (StateBoot, StateBroken, BeginProcess, EndProcess )
	}
}

type Inventory

type Inventory struct {
	Persist     bool    `hcl:"persist"`
	Stocks      []Stock `hcl:"stock"`
	TeleAddName bool    `hcl:"tele_add_name"` // send stock names to telemetry; false to save network usage
}
type MenuItem struct {
	Code      string `hcl:"code,key"`
	Name      string `hcl:"name"`
	XXX_Price int    `hcl:"price"` // use scaled `Price`, this is for decoding config only
	Scenario  string `hcl:"scenario"`

	Price currency.Amount `hcl:"-"`
	Doer  engine.Doer     `hcl:"-"`
}
func (self *MenuItem) String() string

type Stock

type Stock struct {
	Name        string  `hcl:"name,key"`
	Code        int     `hcl:"code"`
	Check       bool    `hcl:"check"`
	Min         float32 `hcl:"min"`
	HwRate      float32 `hcl:"hw_rate"`
	SpendRate   float32 `hcl:"spend_rate"`
	RegisterAdd string  `hcl:"register_add"`
}

func (*Stock) String

func (self *Stock) String() string

Jump to

Keyboard shortcuts

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