# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
CreateNewProcess creates new openvpn process with given config params.
NewCmdWrapper returns process wrapper for given executable.
NewExecCmdTestHelper creates a new ExecCmdTestHelper instance which will run the test function with the name specified by testHelperFuncName when the command is executed in order to mock the command's response.
RunTestExecCmd will simulate the execution of a command by returning a mocked response which includes output to stdout, stderr and a specific exit code.
RunTestExecOpenvpn will run a simulated openvpn management.
# Constants
AddRoutesState indicates that client is setuping routes on tunnel.
AssignIpState indicates that client is trying to setup tunnel with provided ip addresses.
AuthenticatingState is reported by client indicating that client is trying to authenticate itself to server.
ConnectedState is reported by both client and server and means that client is successfully connected and server is ready to server incoming client connect requests.
ConnectingState is reported by client and server mode and is indicator of openvpn startup.
ExitingState is reported by both client and server and means that openvpn process is exiting by any reasons (normal shutdown or fatal error reported before this state).
GetConfigState indicates that client is waiting for config from server (push based options).
ProcessExited state is reported on state middleware stop method to indicate that process disconnected from interface and this is LAST state to report.
ProcessStarted state is reported by state middleware when middleware start method itself is called it means that process successfully connected to management interface.
ReconnectingState indicates that client lost connection and is trying to reconnect itself.
UnknownState is reported when state middleware cannot parse state from string (i.e.
WaitState is reported by client in udp mode indicating that connect request is send and response is waiting.
# Structs
CmdWrapper struct defines process wrapper which handles clean shutdown, tracks executable exit errors, logs stdout and stderr to logger.
ExecCmdTestHelper provides a way to test code that uses exec.Command by providing a mockable function that replaces the real exec.Command function during the test.
ExecCmdTestResult represents the mocked cmd exec result.
OpenvpnProcess represents an openvpn process manager.
# Interfaces
Process defines openvpn process interface with basic controls It must die!.
# Type aliases
CommandFunc represents the func for running external commands.
State type represents valid openvpn states type.