Documentation ¶
Overview ¶
Package cfg dispatches several calculations. It avoids to start a specific program for each calculation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Calculation ¶
type Calculation interface {
Start() error
}
Calculation is an interface that only contains one method: Start. Every calculation must have a Start method that will launch the calculation. It must be a thread blocking method.
type Cfg ¶
Cfg is a structure where the types of calculations are stored. It can be instanced through the New method. The length of the Files slice must be equal to the length of the Types files. Each calculation requires a configuration file where the parameters required to run the calculation are stored.
func New ¶
New returns an instance of the Cfg structure. It opens and reads the configuration file where Types and Files are stored. The configuration file must use the TOML format.
func (Cfg) Start ¶
Start dispatches and performs the calculations. If several calculations are in the same array (e.g Types: ["x", "y", "z"]), they will be performed in parrallel. In general, one calculation uses one thread. The length of the array must be in accordance with the number of threads used by the calculations and the number of threads available.
It is a thread blocking method. If an error occurs for a specific calculation, the calculation will stop and log the error but the method won't stop.