mirror of
https://codeberg.org/scip/swayipc.git
synced 2025-12-16 20:20:56 +01:00
reorg struct + doc
This commit is contained in:
11
net.go
11
net.go
@@ -25,6 +25,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Contains a raw json response, not marshalled yet.
|
||||||
|
type RawResponse struct {
|
||||||
|
PayloadType int
|
||||||
|
Payload []byte
|
||||||
|
}
|
||||||
|
|
||||||
// Connect to unix domain ipc socket.
|
// Connect to unix domain ipc socket.
|
||||||
func (ipc *I3ipc) Connect() error {
|
func (ipc *I3ipc) Connect() error {
|
||||||
if !fileExists(ipc.SocketFile) {
|
if !fileExists(ipc.SocketFile) {
|
||||||
@@ -75,11 +81,6 @@ func (ipc *I3ipc) sendPayload(payload []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type RawResponse struct {
|
|
||||||
PayloadType int
|
|
||||||
Payload []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ipc *I3ipc) readResponse() (*RawResponse, error) {
|
func (ipc *I3ipc) readResponse() (*RawResponse, error) {
|
||||||
// read header
|
// read header
|
||||||
buf := make([]byte, IPC_HEADER_SIZE)
|
buf := make([]byte, IPC_HEADER_SIZE)
|
||||||
|
|||||||
Reference in New Issue
Block a user