Documentation
¶
Index ¶
- Variables
- func FormatFileDate(t time.Time) string
- func FormatHexDump(data []byte, offset int64) []string
- func FormatModTime(t time.Time) string
- func FormatSize(bytes int64) string
- func GetSyntaxHighlightedLine(line string, fileExt string) string
- func GetSyntaxHighlightedLineWithLang(line string, fileExt string, detectedLang string) string
- func IsImageFile(filename string) bool
- func ReadTableData(dbPath, tableName string, offset, limit int) ([]map[string]any, error)
- type App
- type AppInfo
- type ArchiveEntry
- type ArchiveInfo
- type ColumnInfo
- type DatabaseInfo
- type DevicesByRuntime
- type Fetcher
- type FileContent
- type FileInfo
- type FileType
- type ImageInfo
- type ImagePreview
- type Item
- type SimctlFetcher
- type SimctlOutput
- type Simulator
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
var (
ErrSimulatorNotFound = fmt.Errorf("simulator not found")
)
Common errors
Functions ¶
func FormatFileDate ¶
FormatFileDate formats a date for display in the file list
func FormatHexDump ¶
FormatHexDump formats binary data as hex dump
func FormatModTime ¶
FormatModTime formats modification time in a human-friendly way
func FormatSize ¶
FormatSize formats bytes into human readable format
func GetSyntaxHighlightedLine ¶
GetSyntaxHighlightedLine returns a syntax highlighted version of a line This is a simple implementation - could be enhanced with a proper syntax highlighting library
func GetSyntaxHighlightedLineWithLang ¶
GetSyntaxHighlightedLineWithLang returns a syntax highlighted version of a line with support for detected language override
func IsImageFile ¶
IsImageFile checks if a file is a supported image format (including SVG)
Types ¶
type App ¶
type App struct {
Name string
BundleID string
Version string
Size int64
Path string
Container string
SimulatorName string // Name of the parent simulator
SimulatorUDID string // UDID of the parent simulator
ModTime time.Time // Last modified time of the app
}
App represents an installed application
func GetAllApps ¶
GetAllApps returns all apps from all simulators with simulator info populated
type ArchiveEntry ¶
type ArchiveEntry struct {
Name string
Size int64
CompressedSize int64
ModTime time.Time
IsDir bool
}
ArchiveEntry represents a single file or directory in an archive
type ArchiveInfo ¶
type ArchiveInfo struct {
Format string
Entries []ArchiveEntry
FileCount int
FolderCount int
TotalSize int64
CompressedSize int64
}
ArchiveInfo contains information about an archive file
type ColumnInfo ¶
type ColumnInfo struct {
Name string `json:"name"`
Type string `json:"type"`
NotNull bool `json:"not_null"`
PK bool `json:"primary_key"`
}
ColumnInfo represents information about a table column
type DatabaseInfo ¶
type DatabaseInfo struct {
Format string `json:"format"` // "SQLite", "MySQL", etc.
Version string `json:"version"` // Database version
FileSize int64 `json:"file_size"`
TableCount int `json:"table_count"`
Tables []TableInfo `json:"tables"`
Schema string `json:"schema"` // Full schema dump
Error string `json:"error,omitempty"`
}
DatabaseInfo contains information about a database file
func ReadDatabaseContent ¶
func ReadDatabaseContent(path string) (*DatabaseInfo, error)
ReadDatabaseContent reads information from a database file
type DevicesByRuntime ¶
DevicesByRuntime maps runtime identifiers to simulators
type Fetcher ¶
type Fetcher interface {
Fetch() ([]Item, error)
FetchSimulators() ([]Simulator, error)
Boot(udid string) error
}
Fetcher is responsible for fetching simulator information
type FileContent ¶
type FileContent struct {
Type FileType
Lines []string // For text files
TotalLines int // Total number of lines in the file
ImageInfo *ImageInfo
BinaryData []byte // For hex view (current chunk)
BinaryOffset int64 // Offset of the current chunk in the file
TotalSize int64 // Total size of the file (for binary files)
ArchiveInfo *ArchiveInfo // For archive files
DatabaseInfo *DatabaseInfo // For database files
IsBinaryPlist bool // Whether this was converted from binary plist
DetectedLang string // Detected language for syntax highlighting (e.g., "html")
Error error
}
FileContent represents the content of a file prepared for viewing
func ReadFileContent ¶
func ReadFileContent(path string, startLine, maxLines, maxWidth int) (*FileContent, error)
ReadFileContent reads file content based on its type
type FileInfo ¶
type FileInfo struct {
Name string
Path string
Size int64
IsDirectory bool
CreatedAt time.Time
ModifiedAt time.Time
}
FileInfo represents information about a file or directory
func GetFilesForContainer ¶
GetFilesForContainer returns all files and directories in the app's data container
type FileType ¶
type FileType int
FileType represents the type of file for viewing
func DetectFileType ¶
DetectFileType determines the type of file based on content and extension
type ImageInfo ¶
type ImageInfo struct {
Format string
Width int
Height int
Size int64
Preview *ImagePreview
}
ImageInfo contains metadata about an image file
type ImagePreview ¶
type ImagePreview struct {
Width int
Height int
Rows []string // Pre-rendered rows with ANSI colors
}
ImagePreview contains the terminal-renderable preview
type SimctlFetcher ¶
type SimctlFetcher struct{}
SimctlFetcher fetches simulators using xcrun simctl
func (*SimctlFetcher) Boot ¶
func (f *SimctlFetcher) Boot(udid string) error
Boot starts the simulator with the given UDID
func (*SimctlFetcher) Fetch ¶
func (f *SimctlFetcher) Fetch() ([]Item, error)
Fetch retrieves all available iOS simulators
func (*SimctlFetcher) FetchSimulators ¶
func (f *SimctlFetcher) FetchSimulators() ([]Simulator, error)
FetchSimulators retrieves all available simulators without app counts
type SimctlOutput ¶
type SimctlOutput struct {
Devices DevicesByRuntime `json:"devices"`
}
SimctlOutput represents the JSON output from simctl
type Simulator ¶
type Simulator struct {
UDID string `json:"udid"`
Name string `json:"name"`
State string `json:"state"`
IsAvailable bool `json:"isAvailable"`
DeviceTypeIdentifier string `json:"deviceTypeIdentifier"`
}
Simulator represents an iOS simulator device
func (*Simulator) StateDisplay ¶
StateDisplay returns a user-friendly state description