mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-54318] Add file storage information to support package (#24474)
* Reorder stats in support package struct * Add file storage information to support package * Add clusterID * Change method name to DriverName * Ordering * Fix test
This commit is contained in:
@@ -23,6 +23,7 @@ type ReadCloseSeeker interface {
|
||||
}
|
||||
|
||||
type FileBackend interface {
|
||||
DriverName() string
|
||||
TestConnection() error
|
||||
|
||||
Reader(path string) (ReadCloseSeeker, error)
|
||||
|
||||
@@ -68,6 +68,10 @@ func copyFile(src, dst string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (b *LocalFileBackend) DriverName() string {
|
||||
return driverLocal
|
||||
}
|
||||
|
||||
func (b *LocalFileBackend) TestConnection() error {
|
||||
f := bytes.NewReader([]byte("testingwrite"))
|
||||
if _, err := writeFileLocally(f, filepath.Join(b.directory, TestFilePath)); err != nil {
|
||||
|
||||
@@ -57,6 +57,20 @@ func (_m *FileBackend) CopyFile(oldPath string, newPath string) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// DriverName provides a mock function with given fields:
|
||||
func (_m *FileBackend) DriverName() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// FileExists provides a mock function with given fields: path
|
||||
func (_m *FileBackend) FileExists(path string) (bool, error) {
|
||||
ret := _m.Called(path)
|
||||
|
||||
@@ -184,6 +184,10 @@ func (b *S3FileBackend) s3New(isCloud bool) (*s3.Client, error) {
|
||||
return s3Clnt, nil
|
||||
}
|
||||
|
||||
func (b *S3FileBackend) DriverName() string {
|
||||
return driverS3
|
||||
}
|
||||
|
||||
func (b *S3FileBackend) TestConnection() error {
|
||||
exists := true
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user