|
|
@ -12,6 +12,7 @@ import ( |
|
|
|
) |
|
|
|
|
|
|
|
type FileSystem struct { |
|
|
|
cdn string |
|
|
|
root string |
|
|
|
prefix string |
|
|
|
minFreeSize int64 |
|
|
@ -35,6 +36,7 @@ func NewFileSystem(cfg config.Config) (Storage, error) { |
|
|
|
} else { |
|
|
|
fs.root = root |
|
|
|
} |
|
|
|
fs.cdn = cfg.GetString("cdn") |
|
|
|
fs.prefix = cfg.GetString("prefix", "/") |
|
|
|
fs.minFreeSize = cfg.GetInt64("min_free_size", 10*GB) |
|
|
|
fs.allowZeroFile = cfg.GetBool("allow_zero_file", false) |
|
|
@ -45,6 +47,10 @@ func NewFileSystem(cfg config.Config) (Storage, error) { |
|
|
|
return fs, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (fs FileSystem) CDN() string { |
|
|
|
return fs.cdn |
|
|
|
} |
|
|
|
|
|
|
|
func (fs FileSystem) Root() string { |
|
|
|
return fs.root |
|
|
|
} |
|
|
|