Documentation ¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ConnectionReconciled()
- func (c *Client) CreateClient(deviceID, configPath string, isSecure bool) (*Client, error)
- func (c *Client) HandleError(err error)
- func (c *Client) NotifyBroadcastServer(configPath string) error
- func (c *Client) NotifyClose()
- func (c *Client) ParseVirtualIP(parameters string) error
- func (c *Client) Run()
- func (c *Client) SetClient(clientAPI restclient.Clienter)
- func (c *Client) StartRecvRoutine()
- func (c *Client) StartSendRoutine()
- func (c *Client) TunReadRoutine()
- func (c *Client) TunWriteRoutine()
- type MNEDCClient
- type NetPacket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines the MNEDC client struct
func (*Client) ConnectionReconciled ¶
func (c *Client) ConnectionReconciled()
ConnectionReconciled handles the case when MNEDC connection is re-established
func (*Client) CreateClient ¶
CreateClient creates the MNEDC client
func (*Client) HandleError ¶
HandleError handles the error occurred in MNEDC client connection
func (*Client) NotifyBroadcastServer ¶
NotifyBroadcastServer sends request to broadcast server
func (*Client) NotifyClose ¶
func (c *Client) NotifyClose()
NotifyClose handles the case when MNEDC connection is closed
func (*Client) ParseVirtualIP ¶
ParseVirtualIP parses the parameters sent by server
func (*Client) SetClient ¶
func (c *Client) SetClient(clientAPI restclient.Clienter)
SetClient sets the rest client
func (*Client) StartRecvRoutine ¶
func (c *Client) StartRecvRoutine()
StartRecvRoutine reads from server connection and writes on outgoingChannel
func (*Client) StartSendRoutine ¶
func (c *Client) StartSendRoutine()
StartSendRoutine reads from incomingChannel and writes on server connection
func (*Client) TunReadRoutine ¶
func (c *Client) TunReadRoutine()
TunReadRoutine reads from TUN interface and writes on incomingChannel
func (*Client) TunWriteRoutine ¶
func (c *Client) TunWriteRoutine()
TunWriteRoutine reads from outgoingChannel and writes on TUN interface
type MNEDCClient ¶
type MNEDCClient interface { Run() CreateClient(string, string, bool) (*Client, error) Close() error StartSendRoutine() StartRecvRoutine() NotifyClose() ConnectionReconciled() HandleError(error) ParseVirtualIP(string) error TunReadRoutine() TunWriteRoutine() NotifyBroadcastServer(configPath string) error SetClient(clientAPI restclient.Clienter) }
MNEDCClient declares methods related to MNEDC client
func GetInstance ¶
func GetInstance() MNEDCClient
GetInstance returns MNEDCClient interface instance