d57583dfd4
Change-Id: If4df3ec8b3b554f5228d43e97503eb8a87525b23
35 lines
730 B
Go
35 lines
730 B
Go
// Copyright (C) 2021 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package ultest
|
|
|
|
import (
|
|
"context"
|
|
|
|
"storj.io/storj/cmd/uplinkng/ulext"
|
|
"storj.io/storj/cmd/uplinkng/ulfs"
|
|
"storj.io/uplink"
|
|
)
|
|
|
|
type external struct {
|
|
ulext.External
|
|
|
|
fs ulfs.Filesystem
|
|
project *uplink.Project
|
|
}
|
|
|
|
func newExternal(fs ulfs.Filesystem, project *uplink.Project) *external {
|
|
return &external{
|
|
fs: fs,
|
|
project: project,
|
|
}
|
|
}
|
|
|
|
func (ex *external) OpenFilesystem(ctx context.Context, access string, options ...ulext.Option) (ulfs.Filesystem, error) {
|
|
return ex.fs, nil
|
|
}
|
|
|
|
func (ex *external) OpenProject(ctx context.Context, access string, options ...ulext.Option) (*uplink.Project, error) {
|
|
return ex.project, nil
|
|
}
|