reorg struct + doc

This commit is contained in:
2025-08-15 12:41:29 +02:00
parent d3ab7511a0
commit d5e152faf3

11
net.go
View File

@@ -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)