childprocess

package
v0.0.0-...-851e5e8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package child_process contains common utilities for running NordVPN helper apps(eg. fileshare and norduser) as a child process, rather than a system daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildProcessManager

type ChildProcessManager interface {
	// StartProcess starts the fileshare process
	StartProcess() (StartupErrorCode, error)
	// StopProcess stops the fileshare process
	StopProcess(disable bool) error
	// ProcessStatus checks the status of fileshare process
	ProcessStatus() ProcessStatus
}

type GRPCChildProcessManager

type GRPCChildProcessManager struct {
	// contains filtered or unexported fields
}

func NewGRPCChildProcessManager

func NewGRPCChildProcessManager(processClient ProcessClient, processBinaryPath string) *GRPCChildProcessManager

func (*GRPCChildProcessManager) ProcessStatus

func (g *GRPCChildProcessManager) ProcessStatus() ProcessStatus

func (*GRPCChildProcessManager) StartProcess

func (g *GRPCChildProcessManager) StartProcess() (StartupErrorCode, error)

func (*GRPCChildProcessManager) StopProcess

func (g *GRPCChildProcessManager) StopProcess(disable bool) error

type NoopChildProcessManager

type NoopChildProcessManager struct{}

func (NoopChildProcessManager) ProcessStatus

func (c NoopChildProcessManager) ProcessStatus() ProcessStatus

func (NoopChildProcessManager) StartProcess

func (c NoopChildProcessManager) StartProcess() (StartupErrorCode, error)

func (NoopChildProcessManager) StopProcess

func (c NoopChildProcessManager) StopProcess(bool) error

type ProcessClient

type ProcessClient interface {
	Ping(nowait bool) error
	Stop(disable bool) error
}

type ProcessStatus

type ProcessStatus int
const (
	Running ProcessStatus = iota
	RunningForOtherUser
	NotRunning
)

type StartupErrorCode

type StartupErrorCode int
const (
	CodeAlreadyRunning StartupErrorCode = iota + 1
	CodeAlreadyRunningForOtherUser
	CodeFailedToCreateUnixScoket
	CodeMeshnetNotEnabled
	CodeAddressAlreadyInUse
	CodeFailedToEnable
)

Jump to

Keyboard shortcuts

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