admin/sync: handle exercice gain from toml file: defines.txt

This commit is contained in:
nemunaire 2018-01-10 03:45:56 +01:00
commit 332aa90931
2 changed files with 30 additions and 2 deletions

View file

@ -0,0 +1,20 @@
package sync
import (
"path"
"github.com/BurntSushi/toml"
)
type ExerciceParams struct {
Gain int64
}
func parseExerciceParams(i Importer, exPath string) (p ExerciceParams, err error) {
var defs string
defs, err = getFileContent(i, path.Join(exPath, "defines.txt"))
_, err = toml.Decode(defs, &p)
return
}