refactoring: add common package

The common package defines the interfaces that a protocol must implement
and contain code that can be shared among supported protocols.

This way should be easier to support new protocols
This commit is contained in:
Nicola Murino
2020-07-24 23:39:38 +02:00
parent ded8fad5e4
commit 4e41a5583d
62 changed files with 4893 additions and 3140 deletions

View File

@@ -17,8 +17,8 @@ import (
"github.com/go-chi/chi"
"github.com/stretchr/testify/assert"
"github.com/drakkan/sftpgo/common"
"github.com/drakkan/sftpgo/dataprovider"
"github.com/drakkan/sftpgo/sftpd"
"github.com/drakkan/sftpgo/utils"
"github.com/drakkan/sftpgo/vfs"
)
@@ -526,7 +526,7 @@ func TestQuotaScanInvalidFs(t *testing.T) {
Provider: 1,
},
}
sftpd.AddQuotaScan(user.Username)
common.QuotaScans.AddUserQuotaScan(user.Username)
err := doQuotaScan(user)
assert.Error(t, err)
}