Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultServerConfig = ServerConfig{ SocketBasePath: defaultSocketBasePath, Timeout: 0, MaxMsgSize: defaultMaxMsgSize, Encryption: true, UnmaskPermissions: false, } DefaultClientConfig = ClientConfig{ SocketBasePath: defaultSocketBasePath, Timeout: 0, RetryTimer: defaultRetryTimer, MaxMsgSize: defaultMaxMsgSize, Encryption: true, } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Name string // contains filtered or unexported fields }
Client - holds the details of the client connection and config.
func StartClient ¶
func StartClient(ipcName string, config *ClientConfig) (*Client, error)
StartClient - start the ipc client. ipcName = is the name of the unix socket or named pipe that the client will try and connect to.
func (*Client) Read ¶
Read - blocking function that receices messages if MsgType is a negative number its an internal message
type ClientConfig ¶
type ClientConfig struct { SocketBasePath string Timeout time.Duration RetryTimer time.Duration MaxMsgSize int Encryption bool }
ClientConfig - used to pass configuration overrides to ClientStart()
type Message ¶
type Message struct { Err error // details of any error MsgType int // 0 = reserved , -1 is an internal message (disconnection or error etc), all messages recieved will be > 0 Data []byte // message data received Status string // the status of the connection }
Message - contains the received message
type Server ¶
type Server struct { Name string // contains filtered or unexported fields }
Server - holds the details of the server connection & config.
func StartServer ¶
func StartServer(ipcName string, config *ServerConfig) (*Server, error)
StartServer - starts the ipc server.
ipcName - is the name of the unix socket or named pipe that will be created, the client needs to use the same name
func (*Server) Read ¶
Read - blocking function, reads each message recieved if MsgType is a negative number its an internal message
type ServerConfig ¶
type ServerConfig struct { SocketBasePath string Timeout time.Duration MaxMsgSize int Encryption bool UnmaskPermissions bool }
ServerConfig - used to pass configuration overrides to ServerStart()