bbgo_origin/pkg/service/persistence.go

24 lines
512 B
Go
Raw Normal View History

2021-02-20 17:01:39 +00:00
package service
type PersistenceService interface {
NewStore(id string, subIDs ...string) Store
}
type Store interface {
Load(val interface{}) error
Save(val interface{}) error
Reset() error
}
type RedisPersistenceConfig struct {
Host string `json:"host" env:"REDIS_HOST"`
Port string `json:"port" env:"REDIS_PORT"`
Password string `json:"password" env:"REDIS_PASSWORD"`
DB int `json:"db" env:"REDIS_DB"`
}
type JsonPersistenceConfig struct {
Directory string `json:"directory"`
}