manager

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrManagerAlreadyRunning = errors.New("Manager already installed and running")

Functions

func IPCClientQuit

func IPCClientQuit(stopTunnelsOnQuit bool) (alreadyQuit bool, err error)

func IPCClientUpdate

func IPCClientUpdate() error

func IPCServerListen

func IPCServerListen(reader, writer, events *os.File, elevatedToken windows.Token)

func IPCServerNotifyManagerStopping

func IPCServerNotifyManagerStopping()

func IPCServerNotifyTunnelChange

func IPCServerNotifyTunnelChange(name string, state TunnelState, err error)

func IPCServerNotifyTunnelsChange

func IPCServerNotifyTunnelsChange()

func IPCServerNotifyUpdateFound

func IPCServerNotifyUpdateFound(state UpdateState)

func IPCServerNotifyUpdateProgress

func IPCServerNotifyUpdateProgress(dp updater.DownloadProgress)

func InitializeIPCClient

func InitializeIPCClient(reader, writer, events *os.File)

func InstallManager

func InstallManager() error

func InstallTunnel

func InstallTunnel(configPath string) error

func Run added in v0.0.23

func Run() error

func UninstallManager

func UninstallManager() error

func UninstallTunnel

func UninstallTunnel(name string) error

Types

type ManagerService

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

func (*ManagerService) Create

func (s *ManagerService) Create(tunnelConfig *conf.Config) (*Tunnel, error)

func (*ManagerService) Delete

func (s *ManagerService) Delete(tunnelName string) error

func (*ManagerService) GlobalState

func (s *ManagerService) GlobalState() TunnelState

func (*ManagerService) Quit

func (s *ManagerService) Quit(stopTunnelsOnQuit bool) (alreadyQuit bool, err error)

func (*ManagerService) RuntimeConfig

func (s *ManagerService) RuntimeConfig(tunnelName string) (*conf.Config, error)

func (*ManagerService) ServeConn added in v0.0.27

func (s *ManagerService) ServeConn(reader io.Reader, writer io.Writer)

func (*ManagerService) Start

func (s *ManagerService) Start(tunnelName string) error

func (*ManagerService) State

func (s *ManagerService) State(tunnelName string) (TunnelState, error)

func (*ManagerService) Stop

func (s *ManagerService) Stop(tunnelName string) error

func (*ManagerService) StoredConfig

func (s *ManagerService) StoredConfig(tunnelName string) (*conf.Config, error)

func (*ManagerService) Tunnels

func (s *ManagerService) Tunnels() ([]Tunnel, error)

func (*ManagerService) Update

func (s *ManagerService) Update()

func (*ManagerService) UpdateState

func (s *ManagerService) UpdateState() UpdateState

func (*ManagerService) WaitForStop

func (s *ManagerService) WaitForStop(tunnelName string) error

type ManagerStoppingCallback

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

func IPCClientRegisterManagerStopping

func IPCClientRegisterManagerStopping(cb func()) *ManagerStoppingCallback

func (*ManagerStoppingCallback) Unregister

func (cb *ManagerStoppingCallback) Unregister()

type MethodType added in v0.0.27

type MethodType int
const (
	StoredConfigMethodType MethodType = iota
	RuntimeConfigMethodType
	StartMethodType
	StopMethodType
	WaitForStopMethodType
	DeleteMethodType
	StateMethodType
	GlobalStateMethodType
	CreateMethodType
	TunnelsMethodType
	QuitMethodType
	UpdateStateMethodType
	UpdateMethodType
)

type NotificationType

type NotificationType int
const (
	TunnelChangeNotificationType NotificationType = iota
	TunnelsChangeNotificationType
	ManagerStoppingNotificationType
	UpdateFoundNotificationType
	UpdateProgressNotificationType
)

type Tunnel

type Tunnel struct {
	Name string
}

func IPCClientNewTunnel

func IPCClientNewTunnel(conf *conf.Config) (tunnel Tunnel, err error)

func IPCClientTunnels

func IPCClientTunnels() (tunnels []Tunnel, err error)

func (*Tunnel) Delete

func (t *Tunnel) Delete() (err error)

func (*Tunnel) RuntimeConfig

func (t *Tunnel) RuntimeConfig() (c conf.Config, err error)

func (*Tunnel) Start

func (t *Tunnel) Start() (err error)

func (*Tunnel) State

func (t *Tunnel) State() (tunnelState TunnelState, err error)

func (*Tunnel) Stop

func (t *Tunnel) Stop() (err error)

func (*Tunnel) StoredConfig

func (t *Tunnel) StoredConfig() (c conf.Config, err error)

func (*Tunnel) Toggle

func (t *Tunnel) Toggle() (oldState TunnelState, err error)

func (*Tunnel) WaitForStop

func (t *Tunnel) WaitForStop() (err error)

type TunnelChangeCallback

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

func IPCClientRegisterTunnelChange

func IPCClientRegisterTunnelChange(cb func(tunnel *Tunnel, state, globalState TunnelState, err error)) *TunnelChangeCallback

func (*TunnelChangeCallback) Unregister

func (cb *TunnelChangeCallback) Unregister()

type TunnelState

type TunnelState int
const (
	TunnelUnknown TunnelState = iota
	TunnelStarted
	TunnelStopped
	TunnelStarting
	TunnelStopping
)

func IPCClientGlobalState

func IPCClientGlobalState() (tunnelState TunnelState, err error)

type TunnelsChangeCallback

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

func IPCClientRegisterTunnelsChange

func IPCClientRegisterTunnelsChange(cb func()) *TunnelsChangeCallback

func (*TunnelsChangeCallback) Unregister

func (cb *TunnelsChangeCallback) Unregister()

type UpdateFoundCallback

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

func IPCClientRegisterUpdateFound

func IPCClientRegisterUpdateFound(cb func(updateState UpdateState)) *UpdateFoundCallback

func (*UpdateFoundCallback) Unregister

func (cb *UpdateFoundCallback) Unregister()

type UpdateProgressCallback

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

func IPCClientRegisterUpdateProgress

func IPCClientRegisterUpdateProgress(cb func(dp updater.DownloadProgress)) *UpdateProgressCallback

func (*UpdateProgressCallback) Unregister

func (cb *UpdateProgressCallback) Unregister()

type UpdateState

type UpdateState uint32
const (
	UpdateStateUnknown UpdateState = iota
	UpdateStateFoundUpdate
	UpdateStateUpdatesDisabledUnofficialBuild
)

func IPCClientUpdateState

func IPCClientUpdateState() (updateState UpdateState, err error)

Jump to

Keyboard shortcuts

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