kubo/config/datastore.go
rht 14cf564b3a go-ipfs-config: Add fixed period repo GC + test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-11-10 14:03:29 +07:00

20 lines
710 B
Go

package config
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
const DefaultDataStoreDirectory = "datastore"
// Datastore tracks the configuration of the datastore.
type Datastore struct {
Type string
Path string
StorageMax string // in B, kB, kiB, MB, ...
StorageGCWatermark int64 // in percentage to multiply on StorageMax
GCPeriod string // in ns, us, ms, s, m, h
}
// DataStorePath returns the default data store path given a configuration root
// (set an empty string to have the default configuration root)
func DataStorePath(configroot string) (string, error) {
return Path(configroot, DefaultDataStoreDirectory)
}