diff --git a/config/datastore.go b/config/datastore.go index 6749a4c39..89ded36f1 100644 --- a/config/datastore.go +++ b/config/datastore.go @@ -1,5 +1,9 @@ package config +import ( + "encoding/json" +) + // DefaultDataStoreDirectory is the directory to store all the local IPFS data. const DefaultDataStoreDirectory = "datastore" @@ -10,6 +14,22 @@ type Datastore struct { StorageMax string // in B, kB, kiB, MB, ... StorageGCWatermark int64 // in percentage to multiply on StorageMax GCPeriod string // in ns, us, ms, s, m, h + + Params *json.RawMessage +} + +func (d *Datastore) ParamData() []byte { + if d.Params == nil { + return nil + } + + return []byte(*d.Params) +} + +type S3Datastore struct { + Region string `json:"region"` + Bucket string `json:"bucket"` + ACL string `json:"acl"` } // DataStorePath returns the default data store path given a configuration root