Documentation
¶
Overview ¶
Package ipc provides IPC communication between JS and Go using stdio
Index ¶
Constants ¶
View Source
const Version = "1.0.0"
Version is the IPC protocol version
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Diagnostic ¶
type Diagnostic struct {
RuleName string `json:"ruleName"`
Message string `json:"message"`
FilePath string `json:"filePath"`
Range Range `json:"range"`
Severity string `json:"severity,omitempty"`
MessageId string `json:"messageId"`
}
Diagnostic represents a single lint diagnostic
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse represents an error response
type Handler ¶
type Handler interface {
HandleLint(req LintRequest) (*LintResponse, error)
}
Handler defines the interface for handling IPC messages
type HandshakeRequest ¶
type HandshakeRequest struct {
Version string `json:"version"`
}
HandshakeRequest represents a handshake request
type HandshakeResponse ¶
HandshakeResponse represents a handshake response
type LintRequest ¶
type LintRequest struct {
Files []string `json:"files,omitempty"`
Config string `json:"config,omitempty"` // Path to rslint.json config file
Format string `json:"format,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
// Supports both string level and array [level, options] format
RuleOptions map[string]interface{} `json:"ruleOptions,omitempty"`
FileContents map[string]string `json:"fileContents,omitempty"` // Map of file paths to their contents for VFS
}
LintRequest represents a lint request from JS to Go
type LintResponse ¶
type LintResponse struct {
Diagnostics []Diagnostic `json:"diagnostics"`
ErrorCount int `json:"errorCount"`
FileCount int `json:"fileCount"`
RuleCount int `json:"ruleCount"`
}
LintResponse represents a lint response from Go to JS
type Message ¶
type Message struct {
Kind MessageKind `json:"kind"`
ID int `json:"id"`
Data interface{} `json:"data,omitempty"`
}
Message represents an IPC message
type MessageKind ¶
type MessageKind string
MessageKind represents the kind of IPC message
const ( // KindLint is sent from JS to Go to request linting KindLint MessageKind = "lint" // KindResponse is sent from Go to JS with the lint results KindResponse MessageKind = "response" // KindError is sent when an error occurs KindError MessageKind = "error" // KindHandshake is sent for initial connection verification KindHandshake MessageKind = "handshake" // KindExit is sent to request termination KindExit MessageKind = "exit" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the IPC communication
func NewService ¶
NewService creates a new IPC service
Click to show internal directories.
Click to hide internal directories.