ipcclient

package
v0.0.0-...-8dfc95f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPCClient

type IPCClient struct {
	Name string // Name of the module
	Desc string // Description of the module

	Identifier [4]byte // Identifier of the module

	Sock string // Path to the UNIX domain socket
	// contains filtered or unexported fields
}

func NewIPCClient

func NewIPCClient(name string, identifier string, serverId string) *IPCClient

NewIPCClient creates a new IPC client and returns it. The name is the name of the module, and the socketPath is the path to the UNIX domain socket.

func (*IPCClient) AwaitResponse

func (c *IPCClient) AwaitResponse() error

func (*IPCClient) ClientListen

func (c *IPCClient) ClientListen() ipc.IPCResponse

ClientListen listens for a message from the server and returns the data. GenericData is a generic map for data (map[string]interface{}). It can be used to store any data type.

func (*IPCClient) Close

func (c *IPCClient) Close()

Close the connection

func (*IPCClient) Connect

func (c *IPCClient) Connect() error

Connect to the IPC server (UNIX domain socket) Parameter is the name of the module And identifier is the identifier of the server

func (*IPCClient) CreateGenericReq

func (c *IPCClient) CreateGenericReq(message interface{}, t ipc.MsgType, dataType ipc.DataType) *ipc.IPCRequest

func (*IPCClient) CreateReq

func (c *IPCClient) CreateReq(message string, t ipc.MsgType, dataType ipc.DataType) *ipc.IPCRequest

NewMessage creates a new IPC message.

func (*IPCClient) SendIPCMessage

func (c *IPCClient) SendIPCMessage(msg *ipc.IPCRequest, then ...func() error) error

SendIPCMessage sends an IPC message to the server.

func (*IPCClient) SetDescf

func (c *IPCClient) SetDescf(desc string, args ...interface{})

Set description with format string for easier type conversion

func (*IPCClient) SetSocket

func (c *IPCClient) SetSocket(socketPath string) error

func (*IPCClient) Stringify

func (c *IPCClient) Stringify() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL