Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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. config = is a struct containing the configuration options for the client.
func (*Client) Read ¶
Read - blocking function that waits until an non multipart message is recieved returns the message type, data and any error.
func (*Client) StatusCode ¶
StatusCode - returns the current connection status
type ClientConfig ¶
type ClientConfig struct { Timeout float64 RetryTimer time.Duration Encryption bool Network bool NetworkPort int NetworkServer string }
ClientConfig - used to pass configuation overrides to ClientStart()
type Message ¶
type Message struct { MsgType int // type of message sent - 0 is reserved Data []byte // message data recieved Status string // contains filtered or unexported fields }
Message - contains the recieved 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. config = is a struct containing the configuration options for the server.
func (*Server) StatusCode ¶
StatusCode - returns the current connection status
type ServerConfig ¶
type ServerConfig struct { Timeout time.Duration MaxMsgSize int Encryption bool UnmaskPermissions bool Network bool NetworkPort int NetworkListen string }
ServerConfig - used to pass configuation overrides to ServerStart()
type Status ¶
type Status int
Status - Status of the connection
const ( // NotConnected - 0 NotConnected Status = iota // Listening - 1 Listening Status = iota // Connecting - 2 Connecting Status = iota // Connected - 3 Connected Status = iota // ReConnecting - 4 ReConnecting Status = iota // Closed - 5 Closed Status = iota // Closing - 6 Closing Status = iota // Error - 7 Error Status = iota // Timeout - 8 Timeout Status = iota )