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. timeout = number of seconds before the socket/pipe times out trying to connect/re-cconnect - if -1 or 0 it never times out. retryTimer = number of seconds before the client tries to connect again.
func (*Client) Read ¶
Read - blocking function that waits until an non multipart message is received returns the message type, data and any error.
func (*Client) StatusCode ¶
StatusCode - returns the current connection status
type ClientConfig ¶
type ClientConfig struct { Timeout time.Duration RetryTimer time.Duration EncryptionRequired bool SocketBasePath string }
ClientConfig - used to pass configuration overrides to ClientStart()
type Message ¶
type Message struct { MsgType int // type of message sent - 0 is reserved Data []byte // message data received Status string // contains filtered or unexported fields }
Message - contains the received message
type Server ¶
type Server struct {
// 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. timeout = number of seconds before the socket/pipe times out waiting for a connection/re-cconnection - if -1 or 0 it never times out.
func (*Server) StatusCode ¶
StatusCode - returns the current connection status
type ServerConfig ¶
type ServerConfig struct { Timeout time.Duration MaxMsgSize int Encryption bool UnmaskPermissions bool SocketBasePath string }
ServerConfig - used to pass configuration 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 )