2022-05-10 06:05:44 +00:00
|
|
|
package backtest
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
2022-05-10 06:23:11 +00:00
|
|
|
type ManifestEntry struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Filename string `json:"filename"`
|
|
|
|
StrategyID string `json:"strategyID"`
|
|
|
|
StrategyInstance string `json:"strategyInstance"`
|
|
|
|
StrategyProperty string `json:"strategyProperty"`
|
|
|
|
}
|
|
|
|
|
2022-05-10 06:05:44 +00:00
|
|
|
type Manifests map[InstancePropertyIndex]string
|
|
|
|
|
|
|
|
func (m Manifests) MarshalJSON() ([]byte, error) {
|
2022-05-10 06:23:11 +00:00
|
|
|
var arr []ManifestEntry
|
2022-05-10 06:05:44 +00:00
|
|
|
for k, v := range m {
|
2022-05-10 06:23:11 +00:00
|
|
|
arr = append(arr, ManifestEntry{
|
|
|
|
Type: "strategyProperty",
|
|
|
|
Filename: v,
|
|
|
|
StrategyID: k.ID,
|
|
|
|
StrategyInstance: k.InstanceID,
|
|
|
|
StrategyProperty: k.Property,
|
2022-05-10 06:05:44 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
return json.MarshalIndent(arr, "", " ")
|
|
|
|
}
|