跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

windows_storage_nonwindows.go

41 行 · 1.0 KB历史下载
1//go:build !windows
2
3package guestos
4
5import (
6 "context"
7 "errors"
8 "io"
9 "os"
10 "path/filepath"
11
12 "github.com/google/uuid"
13)
14
15func windowsHostStorage(context.Context, uuid.UUID, windowsHostStorageRequest) (windowsHostStorageState, error) {
16 return windowsHostStorageState{}, errors.New("Windows 客机存储迁移需要 Windows Hyper-V 主机")
17}
18
19func WindowsPrivateStoragePaths() []string { return nil }
20
21func prepareWindowsStorageDisk(context.Context, string, string) error { return nil }
22
23func RepairWindowsHostManager(context.Context, string, string, io.Writer, io.Writer) error {
24 return errors.New("Windows 系统助手需要在原 Windows 主机上恢复")
25}
26
27func replaceWindowsStorageProfile(path string, data []byte) error {
28 file, err := os.CreateTemp(filepath.Dir(path), ".windows-storage-*")
29 if err != nil {
30 return err
31 }
32 defer os.Remove(file.Name())
33 _, err = file.Write(data)
34 if err == nil {
35 err = file.Sync()
36 }
37 if err = errors.Join(err, file.Close()); err != nil {
38 return err
39 }
40 return os.Rename(file.Name(), path)
41}