mirror of
https://github.com/datarhei/core.git
synced 2025-10-20 22:49:50 +08:00
Refactor internal filesystem handling
This commit is contained in:
@@ -135,6 +135,8 @@ func NewDiskFilesystem(config DiskConfig) (Filesystem, error) {
|
||||
fs.logger = log.New("")
|
||||
}
|
||||
|
||||
fs.logger = fs.logger.WithField("type", "disk")
|
||||
|
||||
if err := fs.Rebase(config.Dir); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -172,6 +174,10 @@ func (fs *diskFilesystem) Rebase(base string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (fs *diskFilesystem) Type() string {
|
||||
return "diskfs"
|
||||
}
|
||||
|
||||
func (fs *diskFilesystem) Size() (int64, int64) {
|
||||
// This is to cache the size for some time in order not to
|
||||
// stress the underlying filesystem too much.
|
||||
|
Reference in New Issue
Block a user