client

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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) Close

func (c *Client) Close() error

Close shuts down the client, reversing configuration changes to the system.

func (*Client) ConnectionReconciled

func (c *Client) ConnectionReconciled()

ConnectionReconciled handles the case when MNEDC connection is re-established

func (*Client) CreateClient

func (c *Client) CreateClient(deviceID, configPath string, isSecure bool) (*Client, error)

CreateClient creates the MNEDC client

func (*Client) HandleError

func (c *Client) HandleError(err error)

HandleError handles the error occurred in MNEDC client connection

func (*Client) NotifyBroadcastServer

func (c *Client) NotifyBroadcastServer(configPath string) error

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

func (c *Client) ParseVirtualIP(parameters string) error

ParseVirtualIP parses the parameters sent by server

func (*Client) Run

func (c *Client) Run()

Run starts the MNEDC client

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

type NetPacket

type NetPacket struct {
	Packet []byte
}

NetPacket defines the packet struct

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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