service

package
v1.6.27 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const RestartExitCode = 23

RestartExitCode will instruct portmaster-start to restart the process immediately, potentially with a new version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {

	// SPN modules
	SpnGroup *mgr.ExtendedGroup

	CommandLineOperation func() error
	// contains filtered or unexported fields
}

Instance is an instance of a Portmaster service.

func New

func New(svcCfg *ServiceConfig) (*Instance, error)

New returns a new Portmaster service instance.

func (*Instance) API

func (i *Instance) API() *api.API

API returns the api module.

func (*Instance) Access

func (i *Instance) Access() *access.Access

Access returns the access module.

func (*Instance) AddStatesCallback

func (i *Instance) AddStatesCallback(callbackName string, callback mgr.EventCallbackFunc[mgr.StateUpdate])

AddStatesCallback adds the given callback function to all group modules that expose a state manager at States().

func (*Instance) AddWorkerInfoToDebugInfo added in v1.6.22

func (i *Instance) AddWorkerInfoToDebugInfo(di *debug.Info)

AddWorkerInfoToDebugInfo adds the worker info of all running workers to the debug info.

func (*Instance) Base

func (i *Instance) Base() *base.Base

Base returns the base module.

func (*Instance) Broadcasts

func (i *Instance) Broadcasts() *broadcasts.Broadcasts

Broadcasts returns the broadcast module.

func (*Instance) Cabin

func (i *Instance) Cabin() *cabin.Cabin

Cabin returns the cabin module.

func (*Instance) Captain

func (i *Instance) Captain() *captain.Captain

Captain returns the captain module.

func (*Instance) Compat

func (i *Instance) Compat() *compat.Compat

Compat returns the compat module.

func (*Instance) Config

func (i *Instance) Config() *config.Config

Config returns the config module.

func (*Instance) Core

func (i *Instance) Core() *core.Core

Core returns the core module.

func (*Instance) Crew

func (i *Instance) Crew() *crew.Crew

Crew returns the crew module.

func (*Instance) Ctx

func (i *Instance) Ctx() context.Context

Ctx returns the instance context. It is only canceled on shutdown.

func (*Instance) CustomList

func (i *Instance) CustomList() *customlists.CustomList

CustomList returns the customlist module.

func (*Instance) DNSMonitor added in v1.6.27

func (i *Instance) DNSMonitor() *dnsmonitor.DNSMonitor

DNSMonitor returns the dns-listener module.

func (*Instance) Database

func (i *Instance) Database() *dbmodule.DBModule

Database returns the database module.

func (*Instance) Docks

func (i *Instance) Docks() *docks.Docks

Docks returns the crew module.

func (*Instance) ExitCode

func (i *Instance) ExitCode() int

ExitCode returns the set exit code of the instance.

func (*Instance) FilterLists

func (i *Instance) FilterLists() *filterlists.FilterLists

FilterLists returns the filterLists module.

func (*Instance) Firewall

func (i *Instance) Firewall() *firewall.Firewall

Firewall returns the firewall module.

func (*Instance) GeoIP

func (i *Instance) GeoIP() *geoip.GeoIP

GeoIP returns the geoip module.

func (*Instance) GetEventSPNConnected

func (i *Instance) GetEventSPNConnected() *mgr.EventMgr[struct{}]

GetEventSPNConnected return the event manager for the SPN connected event.

func (*Instance) GetStates

func (i *Instance) GetStates() []mgr.StateUpdate

GetStates returns the current states of all group modules.

func (*Instance) GetWorkerInfo added in v1.6.22

func (i *Instance) GetWorkerInfo() (*mgr.WorkerInfo, error)

GetWorkerInfo returns the worker info of all running workers.

func (*Instance) Interception

func (i *Instance) Interception() *interception.Interception

Interception returns the interception module.

func (*Instance) Metrics

func (i *Instance) Metrics() *metrics.Metrics

Metrics returns the metrics module.

func (*Instance) NameServer

func (i *Instance) NameServer() *nameserver.NameServer

NameServer returns the nameserver module.

func (*Instance) Navigator

func (i *Instance) Navigator() *navigator.Navigator

Navigator returns the navigator module.

func (*Instance) NetEnv

func (i *Instance) NetEnv() *netenv.NetEnv

NetEnv returns the netenv module.

func (*Instance) NetQuery

func (i *Instance) NetQuery() *netquery.NetQuery

NetQuery returns the netquery module.

func (*Instance) Network

func (i *Instance) Network() *network.Network

Network returns the network module.

func (*Instance) Notifications

func (i *Instance) Notifications() *notifications.Notifications

Notifications returns the notifications module.

func (*Instance) OSIntegration added in v1.6.27

func (i *Instance) OSIntegration() *integration.OSIntegration

OSIntegration returns the integration module.

func (*Instance) Patrol

func (i *Instance) Patrol() *patrol.Patrol

Patrol returns the patrol module.

func (*Instance) Process

func (i *Instance) Process() *process.ProcessModule

Process returns the process module.

func (*Instance) Profile

func (i *Instance) Profile() *profile.ProfileModule

Profile returns the profile module.

func (*Instance) Ready

func (i *Instance) Ready() bool

Ready returns whether all modules in the main service module group have been started and are still running.

func (*Instance) Resolver

func (i *Instance) Resolver() *resolver.ResolverModule

Resolver returns the resolver module.

func (*Instance) Restart

func (i *Instance) Restart()

Restart asynchronously restarts the instance. This only works if the underlying system/process supports this.

func (*Instance) Rng

func (i *Instance) Rng() *rng.Rng

Rng returns the rng module.

func (*Instance) Runtime

func (i *Instance) Runtime() *runtime.Runtime

Runtime returns the runtime module.

func (*Instance) SPNGroup

func (i *Instance) SPNGroup() *mgr.ExtendedGroup

SPNGroup returns the group of all SPN modules.

func (*Instance) SetCmdLineOperation

func (i *Instance) SetCmdLineOperation(f func() error)

SetCmdLineOperation sets a command line operation to be executed instead of starting the system. This is useful when functions need all modules to be prepared for a special operation.

func (*Instance) SetSleep

func (i *Instance) SetSleep(enabled bool)

SetSleep sets sleep mode on all modules that satisfy the SleepyModule interface.

func (*Instance) Ships

func (i *Instance) Ships() *ships.Ships

Ships returns the ships module.

func (*Instance) Shutdown

func (i *Instance) Shutdown()

Shutdown asynchronously stops the instance.

func (*Instance) Sluice

func (i *Instance) Sluice() *sluice.SluiceModule

Sluice returns the ships module.

func (*Instance) Start

func (i *Instance) Start() error

Start starts the instance.

func (*Instance) Status

func (i *Instance) Status() *status.Status

Status returns the status module.

func (*Instance) Stop

func (i *Instance) Stop() error

Stop stops the instance and cancels the instance context when done.

func (*Instance) Stopped

func (i *Instance) Stopped() <-chan struct{}

Stopped returns a channel that is triggered when the instance has shut down.

func (*Instance) Stopping

func (i *Instance) Stopping() bool

Stopping returns whether the instance is shutting down.

func (*Instance) Sync

func (i *Instance) Sync() *sync.Sync

Sync returns the sync module.

func (*Instance) Terminal

func (i *Instance) Terminal() *terminal.TerminalModule

Terminal returns the terminal module.

func (*Instance) UI

func (i *Instance) UI() *ui.UI

UI returns the ui module.

func (*Instance) Updates

func (i *Instance) Updates() *updates.Updates

Updates returns the updates module.

type ServiceConfig

type ServiceConfig struct{}

type SleepyModule

type SleepyModule interface {
	SetSleep(enabled bool)
}

SleepyModule is an interface for modules that can enter some sort of sleep mode.

Directories

Path Synopsis
detection
dga
interception/nfq
Package nfq contains a nfqueue library experiment.
Package nfq contains a nfqueue library experiment.
interception/windowskext
Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
interception/windowskext2
Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
Package mgr provides simple managing of flow control and logging.
Package mgr provides simple managing of flow control and logging.
orm
Package process fetches process and socket information from the operating system.
Package process fetches process and socket information from the operating system.
Package resolver is responsible for querying DNS.
Package resolver is responsible for querying DNS.

Jump to

Keyboard shortcuts

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