feat: import Sea vHost single-server testing release
This commit is contained in:
commit
248badd33e
441 files changed
+63221
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
"sea-vhost/internal/nodefiles"
|
||||
)
|
||||
|
||||
func (s *Projects) WithFileOpener(open func(context.Context, string) (*nodefiles.Root, error)) *Projects {
|
||||
s.fileOpener = open
|
||||
return s
|
||||
}
|
||||
func (s *Projects) OpenFiles(ctx context.Context, root string) (*nodefiles.Root, error) {
|
||||
if s.fileOpener != nil {
|
||||
return s.fileOpener(ctx, root)
|
||||
}
|
||||
return nodefiles.New(ctx, filepath.Base(root), func(_ context.Context, q nodefiles.Request) (nodefiles.Response, error) {
|
||||
return nodefiles.Execute(root, q), nil
|
||||
}), nil
|
||||
}
|
||||
Reference in new issue
Block a user