35 lines
935 B
Go
35 lines
935 B
Go
package model
|
|
|
|
// WriteFileRequest is the request body for writing a file.
|
|
type WriteFileRequest struct {
|
|
Path string `json:"path"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
// MkdirRequest is the request body for creating a directory.
|
|
type MkdirRequest struct {
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
// RenameRequest is the request body for renaming a file or directory.
|
|
type RenameRequest struct {
|
|
OldPath string `json:"oldPath"`
|
|
NewPath string `json:"newPath"`
|
|
}
|
|
|
|
// ReadFileResponse is the API response for reading a file.
|
|
type ReadFileResponse struct {
|
|
Path string `json:"path"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
// FileInfoResponse is the API response for file stat.
|
|
// Path is always workspace-relative; host absolute paths are never exposed.
|
|
type FileInfoResponse struct {
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
IsDir bool `json:"isDir"`
|
|
Size int64 `json:"size"`
|
|
ModTime string `json:"modTime"`
|
|
}
|