Documentation
¶
Index ¶
- func CanonicalRoot(path string) (string, error)
- func WalkFiles(root string, fn func(path string, entry fs.DirEntry) error) error
- type Content
- type Entry
- type FileCandidate
- type Guard
- func (g *Guard) AuthorizeRoot(path string) (string, error)
- func (g *Guard) List(root, relative string) ([]Entry, error)
- func (g *Guard) Read(root, relative string, maxBytes int64) (Content, error)
- func (g *Guard) Resolve(root, relative string) (string, error)
- func (g *Guard) ResolveForCreate(root, relative string) (string, error)
- func (g *Guard) Search(root, query string, limit int) ([]FileCandidate, error)
- type ProjectCandidate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalRoot ¶
Types ¶
type FileCandidate ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
func (*Guard) ResolveForCreate ¶
type ProjectCandidate ¶
type ProjectCandidate struct {
Name string `json:"name"`
Path string `json:"path"`
GitRepository bool `json:"gitRepository"`
ModifiedAt time.Time `json:"modifiedAt"`
}
ProjectCandidate 是 Runner 在本机发现的项目目录。结果只通过实时命令返回, 不写入 Runner 工作区状态;真正授权时仍需再次通过 CanonicalRoot 校验。
func DiscoverProjects ¶
func DiscoverProjects(ctx context.Context, roots []string, limit, maxDepth int) ([]ProjectCandidate, error)
DiscoverProjects 在有限深度和目录数内寻找常见项目标记,不跟随符号链接, 也不会返回 Home、系统根目录或敏感配置目录。
Click to show internal directories.
Click to hide internal directories.