package daemon import "github.com/tzgyn/share/src/swarm" // request/response are the only vocabulary spoken over the control // socket between a CLI invocation and the background daemon. type request struct { Action string `json:"action"` // "join", "stop", or "status" Join *joinRequest `json:"join,omitempty"` } // joinRequest asks the daemon to start participating in a room. Paths // must already be absolute — the daemon may have been started long ago // from a different working directory than whichever CLI invocation is // submitting this request. type joinRequest struct { RelayAddress string `json:"relay"` Code string `json:"code"` Files []string `json:"files,omitempty"` OutDir string `json:"out,omitempty"` OneTime bool `json:"oneTime,omitempty"` } type response struct { OK bool `json:"ok"` Error string `json:"error,omitempty"` Rooms []swarm.RoomStatus `json:"rooms,omitempty"` // "status" only }