refactor: Use interface for logger instead of private struct

This commit is contained in:
Felicitas Pojtinger
2022-01-01 23:12:32 +01:00
parent 9058942443
commit cfbb936954
4 changed files with 21 additions and 10 deletions

View File

@@ -14,10 +14,10 @@ import (
models "github.com/pojntfx/stfs/internal/db/sqlite/models/metadata"
ifs "github.com/pojntfx/stfs/internal/fs"
"github.com/pojntfx/stfs/internal/logging"
"github.com/pojntfx/stfs/pkg/cache"
"github.com/pojntfx/stfs/pkg/config"
"github.com/pojntfx/stfs/pkg/inventory"
"github.com/pojntfx/stfs/pkg/logging"
"github.com/pojntfx/stfs/pkg/operations"
"github.com/spf13/afero"
)
@@ -35,7 +35,7 @@ type STFS struct {
ioLock sync.Mutex
onHeader func(hdr *models.Header)
log *logging.JSONLogger
log logging.StructuredLogger
}
func NewSTFS(
@@ -49,7 +49,7 @@ func NewSTFS(
ignorePermissionFlags bool,
onHeader func(hdr *models.Header),
log *logging.JSONLogger,
log logging.StructuredLogger,
) *STFS {
return &STFS{
readOps: readOps,