Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageTool ¶ added in v0.7.0
type ImageTool struct {
// contains filtered or unexported fields
}
ImageTool is an instance-owned image tool runner. It centralizes path resolution and sandbox policy:
- workBaseDir: base for resolving relative paths
- allowedRoots: optional restriction; if empty/nil, allow all
- blockSymlinks: blocks symlink traversal (if enforced downstream).
func NewImageTool ¶ added in v0.7.0
func NewImageTool(opts ...ImageToolOption) (*ImageTool, error)
func (*ImageTool) ReadImage ¶ added in v0.7.0
func (it *ImageTool) ReadImage(ctx context.Context, args ReadImageArgs) (*ReadImageOut, error)
func (*ImageTool) ReadImageTool ¶ added in v0.7.0
type ImageToolOption ¶ added in v0.7.0
func WithAllowedRoots ¶ added in v0.7.0
func WithAllowedRoots(roots []string) ImageToolOption
func WithBlockSymlinks ¶ added in v0.10.0
func WithBlockSymlinks(block bool) ImageToolOption
WithBlockSymlinks configures whether symlink traversal should be blocked (if supported downstream).
func WithWorkBaseDir ¶ added in v0.7.0
func WithWorkBaseDir(base string) ImageToolOption
type ReadImageArgs ¶ added in v0.3.0
type ReadImageOut ¶ added in v0.3.0
type ReadImageOut struct {
Path string `json:"path"`
Name string `json:"name"`
Exists bool `json:"exists"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ModTime *time.Time `json:"modTime,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Format string `json:"format,omitempty"` // "png", "jpeg", ...
MIMEType string `json:"mimeType,omitempty"` // "image/png", ...
// Optional content.
Base64Data string `json:"base64Data,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.