mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
fix persistence config unmarshalling
This commit is contained in:
parent
20d673f769
commit
e29d9af9c8
1
go.sum
1
go.sum
|
@ -360,6 +360,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||||
|
|
1
pkg/bbgo/testdata/persistence.yaml
vendored
1
pkg/bbgo/testdata/persistence.yaml
vendored
|
@ -19,6 +19,7 @@ persistence:
|
||||||
database: "persistence"
|
database: "persistence"
|
||||||
|
|
||||||
strategies:
|
strategies:
|
||||||
|
- on: max
|
||||||
swing:
|
swing:
|
||||||
symbolPosition:
|
symbolPosition:
|
||||||
persistence:
|
persistence:
|
||||||
|
|
|
@ -11,13 +11,12 @@ type Store interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RedisPersistenceConfig struct {
|
type RedisPersistenceConfig struct {
|
||||||
Host string `json:"host" env:"REDIS_HOST"`
|
Host string `yaml:"host" json:"host" env:"REDIS_HOST"`
|
||||||
Port string `json:"port" env:"REDIS_PORT"`
|
Port string `yaml:"port" json:"port" env:"REDIS_PORT"`
|
||||||
Password string `json:"password" env:"REDIS_PASSWORD"`
|
Password string `yaml:"password,omitempty" json:"password,omitempty" env:"REDIS_PASSWORD"`
|
||||||
DB int `json:"db" env:"REDIS_DB"`
|
DB int `yaml:"db" json:"db" env:"REDIS_DB"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JsonPersistenceConfig struct {
|
type JsonPersistenceConfig struct {
|
||||||
Directory string `json:"directory"`
|
Directory string `yaml:"directory" json:"directory"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user