diff --git a/storage/filesystem.go b/storage/filesystem.go index cd19f4d..04e383d 100644 --- a/storage/filesystem.go +++ b/storage/filesystem.go @@ -26,10 +26,10 @@ import ( ) type filesystemBackend struct { - path string - caldavPrefix string - carddavPrefix string - userPrincipalBackend webdav.UserPrincipalBackend + webdav.UserPrincipalBackend + path string + caldavPrefix string + carddavPrefix string } var ( @@ -45,20 +45,16 @@ func NewFilesystem(fsPath, caldavPrefix, carddavPrefix string, userPrincipalBack return nil, nil, fmt.Errorf("base path for filesystem backend must be a directory") } backend := &filesystemBackend{ + UserPrincipalBackend: userPrincipalBackend, path: fsPath, caldavPrefix: caldavPrefix, carddavPrefix: carddavPrefix, - userPrincipalBackend: userPrincipalBackend, } return backend, backend, nil } -func (b *filesystemBackend) CurrentUserPrincipal(ctx context.Context) (string, error) { - return b.userPrincipalBackend.CurrentUserPrincipal(ctx) -} - func (b *filesystemBackend) AddressbookHomeSetPath(ctx context.Context) (string, error) { - upPath, err := b.userPrincipalBackend.CurrentUserPrincipal(ctx) + upPath, err := b.CurrentUserPrincipal(ctx) if err != nil { return "", err } @@ -67,7 +63,7 @@ func (b *filesystemBackend) AddressbookHomeSetPath(ctx context.Context) (string, } func (b *filesystemBackend) CalendarHomeSetPath(ctx context.Context) (string, error) { - upPath, err := b.userPrincipalBackend.CurrentUserPrincipal(ctx) + upPath, err := b.CurrentUserPrincipal(ctx) if err != nil { return "", err }