Files
kopia/internal/server/api_user.go
Jarek Kowalski 9cba4a97be refactor(repository): major server code refactoring (#1837)
This removes big shared lock held for for the duration of each request
and replaces it with trivially short lock to capture the current
state of the server/repository before passing it to handlers.

Handlers are now limited to only accessing a small subset of Server
functionality to be able to better reason about them.
2022-03-19 22:01:38 -07:00

16 lines
339 B
Go

package server
import (
"context"
"github.com/kopia/kopia/internal/serverapi"
"github.com/kopia/kopia/repo"
)
func handleCurrentUser(ctx context.Context, rc requestContext) (interface{}, *apiError) {
return serverapi.CurrentUserResponse{
Username: repo.GetDefaultUserName(ctx),
Hostname: repo.GetDefaultHostName(ctx),
}, nil
}