Documentation ¶
Overview ¶
docker contains functions to handle docker containers related to the OpenVPN and Bridge services.
Index ¶
- Variables
- func CreateVolume()
- func GenerateClientCert() []byte
- func GetLogs(ctx context.Context, cli *client.Client, contName string) (logOutput io.ReadCloser)
- func InitPKI()
- func PullImages()
- func RunCmdInContainer(img string, net *network.NetworkingConfig, cmd []string, cfg *CmdConfig, ...)
- func RunVPN()
- func StopContainer(containerName string, remove bool)
- func StopVPN()
- type CmdConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Container names will break when we have >1 container running for each type ContainerNameVPN = "openvpn" ContainerNameMenshen = "menshen" ContainerNameBridge = "obfsvpn" NetworkName = "vpn-net" )
View Source
var (
HostName = "localhost"
)
View Source
var (
// Timeout for stopping/removing, in seconds.
Timeout = 10
)
Functions ¶
func CreateVolume ¶
func CreateVolume()
func GenerateClientCert ¶
func GenerateClientCert() []byte
func GetLogs ¶
GetLogs return logs from the container io.ReadCloser. It's the caller duty to do a stdcopy.StdCopy. Any other method might render unknown unicode character as log output has both stdout and stderr. That starting has info if that line is stderr or stdout.
func PullImages ¶
func PullImages()
func RunCmdInContainer ¶
func RunCmdInContainer(img string, net *network.NetworkingConfig, cmd []string, cfg *CmdConfig, bufOut io.ReadWriter)
RunCmdInContainer executes the passed command in the specified container.
func StopContainer ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.