Documentation
¶
Index ¶
- func ReadMessage(r io.Reader, dst interface{}) error
- func WriteMessage(w io.Writer, msg interface{}) error
- type AttachPayload
- type DetachPayload
- type ListResponsePayload
- type RemovePayload
- type Request
- type Response
- type ServiceInfo
- type StartPayload
- type StartResponsePayload
- type StopPayload
- type TargetStartPayload
- type TargetStopPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadMessage ¶
ReadMessage reads a length-prefixed JSON message and decodes it into dst.
func WriteMessage ¶
WriteMessage encodes msg as JSON and writes it with a 4-byte big-endian length prefix.
Types ¶
type AttachPayload ¶
type AttachPayload struct {
Name string `json:"name"`
}
type DetachPayload ¶
type DetachPayload struct {
Name string `json:"name"`
}
type ListResponsePayload ¶
type ListResponsePayload struct {
Services []ServiceInfo `json:"services"`
// ActiveTargets names the targets the daemon currently considers started,
// sorted. Empty when no target has been started.
ActiveTargets []string `json:"active_targets,omitempty"`
}
type RemovePayload ¶
type RemovePayload struct {
Name string `json:"name"`
}
type Request ¶
type Request struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
}
Request is the envelope for all CLI→daemon requests.
type Response ¶
type Response struct {
OK bool `json:"ok"`
Payload json.RawMessage `json:"payload,omitempty"`
Error string `json:"error,omitempty"`
EOF bool `json:"eof,omitempty"`
}
Response is the envelope for all daemon→CLI responses.
type ServiceInfo ¶
type StartPayload ¶
type StartPayload struct {
Name string `json:"name"`
Config *config.ServiceConfig `json:"config,omitempty"`
}
StartPayload names the service to start. Config, when set, carries the full service definition inline (used for project devrun.yaml services that are not in the global registry); when nil the daemon resolves Name from the registry.
type StartResponsePayload ¶
type StartResponsePayload struct {
PID int `json:"pid"`
}
type StopPayload ¶
type StopPayload struct {
Name string `json:"name"`
}
type TargetStartPayload ¶
type TargetStartPayload struct {
Name string `json:"name"`
Services []*config.ServiceConfig `json:"services"`
}
TargetStartPayload starts every service in a target. Services carries the full definitions inline — the daemon has no target vocabulary of its own — the same way project devrun.yaml services are shipped in StartPayload.
type TargetStopPayload ¶
type TargetStopPayload struct {
Name string `json:"name"`
}
TargetStopPayload stops a target. The daemon resolves which members to stop from the snapshot it recorded at target-start time, skipping any still held by another active target.