bbgo_origin/pkg/service/persistence.go
2021-02-21 01:01:39 +08:00

24 lines
512 B
Go

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"`
}