Documentation
¶
Overview ¶
Package devtools provides a devtools service for the tygor vite plugin.
Package devtools provides types for the tygor vite plugin dev server protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfoResponse ¶
type InfoResponse struct {
Port int `json:"port"`
Version string `json:"version"`
NumGoroutines int `json:"num_goroutines"`
NumCPU int `json:"num_cpu"`
Memory MemoryStats `json:"memory"`
}
InfoResponse provides runtime information about the server.
type MemoryStats ¶
type MemoryStats struct {
Alloc uint64 `json:"alloc"`
TotalAlloc uint64 `json:"total_alloc"`
Sys uint64 `json:"sys"`
NumGC uint32 `json:"num_gc"`
}
MemoryStats contains memory statistics.
type PingResponse ¶
type PingResponse struct {
OK bool `json:"ok"`
}
PingResponse is the response for Devtools.Ping.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides devtools endpoints for the vite plugin. Register it on your App to enable devtools integration:
app := tygor.NewApp() devtools.New(app, 8080).Register()
func (*Service) Info ¶
func (s *Service) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error)
Info returns runtime information about the server.
func (*Service) Ping ¶
func (s *Service) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error)
Ping is a simple health check endpoint for heartbeat.
func (*Service) Register ¶
func (s *Service) Register()
Register adds the devtools service to the app.
func (*Service) Status ¶
func (s *Service) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error)
Status returns server status. For service discovery, use Discovery.Describe instead.
type StatusRequest ¶
type StatusRequest struct {
// Initial should be true on first request to receive one-time data.
Initial bool `json:"initial,omitempty"`
}
StatusRequest is the request for Devtools.Status.
type StatusResponse ¶
type StatusResponse struct {
// OK indicates the server is healthy.
OK bool `json:"ok"`
// Port is the server's listening port.
Port int `json:"port"`
// RawrData contains encoded data blobs (sent on initial request).
RawrData []string `json:"rawrData,omitempty"`
}
StatusResponse provides server status. For service discovery with type schemas, use Discovery.Describe instead.