Documentation
¶
Index ¶
- Variables
- type API
- func (api *API) HandleEditFiles(rw http.ResponseWriter, r *http.Request)
- func (api *API) HandleLS(rw http.ResponseWriter, r *http.Request)
- func (api *API) HandleReadFile(rw http.ResponseWriter, r *http.Request)
- func (api *API) HandleReadFileLines(rw http.ResponseWriter, r *http.Request)
- func (api *API) HandleResolvePath(rw http.ResponseWriter, r *http.Request)
- func (api *API) HandleWriteFile(rw http.ResponseWriter, r *http.Request)
- func (api *API) Routes() http.Handler
- type HTTPResponseCode
- type ReadFileLinesResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var WindowsDriveRegex = regexp.MustCompile(`^[a-zA-Z]:\\$`)
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API exposes file-related operations performed through the agent.
func (*API) HandleEditFiles ¶
func (api *API) HandleEditFiles(rw http.ResponseWriter, r *http.Request)
func (*API) HandleReadFile ¶
func (api *API) HandleReadFile(rw http.ResponseWriter, r *http.Request)
func (*API) HandleReadFileLines ¶ added in v2.32.0
func (api *API) HandleReadFileLines(rw http.ResponseWriter, r *http.Request)
func (*API) HandleResolvePath ¶ added in v2.33.0
func (api *API) HandleResolvePath(rw http.ResponseWriter, r *http.Request)
HandleResolvePath resolves the existing portion of an absolute path through any symlinks and returns the resulting path. Missing trailing components are preserved so callers can validate future writes against the real target.
func (*API) HandleWriteFile ¶
func (api *API) HandleWriteFile(rw http.ResponseWriter, r *http.Request)
type HTTPResponseCode ¶
type HTTPResponseCode = int
type ReadFileLinesResponse ¶ added in v2.32.0
type ReadFileLinesResponse struct {
// Success indicates whether the read was successful.
Success bool `json:"success"`
// FileSize is the original file size in bytes.
FileSize int64 `json:"file_size,omitempty"`
// TotalLines is the total number of lines in the file.
TotalLines int `json:"total_lines,omitempty"`
// LinesRead is the count of lines returned in this response.
LinesRead int `json:"lines_read,omitempty"`
// Content is the line-numbered file content.
Content string `json:"content,omitempty"`
// Error is the error message when success is false.
Error string `json:"error,omitempty"`
}
ReadFileLinesResponse is the JSON response for the line-based file reader.
Click to show internal directories.
Click to hide internal directories.