Documentation ¶
Index ¶
- Constants
- type Instance
- func (i *Instance) API() *api.API
- func (i *Instance) Access() *access.Access
- func (i *Instance) AddStatesCallback(callbackName string, callback mgr.EventCallbackFunc[mgr.StateUpdate])
- func (i *Instance) Base() *base.Base
- func (i *Instance) Broadcasts() *broadcasts.Broadcasts
- func (i *Instance) Cabin() *cabin.Cabin
- func (i *Instance) Captain() *captain.Captain
- func (i *Instance) Compat() *compat.Compat
- func (i *Instance) Config() *config.Config
- func (i *Instance) Core() *core.Core
- func (i *Instance) Crew() *crew.Crew
- func (i *Instance) Ctx() context.Context
- func (i *Instance) CustomList() *customlists.CustomList
- func (i *Instance) Database() *dbmodule.DBModule
- func (i *Instance) Docks() *docks.Docks
- func (i *Instance) ExitCode() int
- func (i *Instance) FilterLists() *filterlists.FilterLists
- func (i *Instance) Firewall() *firewall.Firewall
- func (i *Instance) GeoIP() *geoip.GeoIP
- func (i *Instance) GetEventSPNConnected() *mgr.EventMgr[struct{}]
- func (i *Instance) GetStates() []mgr.StateUpdate
- func (i *Instance) Interception() *interception.Interception
- func (i *Instance) Metrics() *metrics.Metrics
- func (i *Instance) NameServer() *nameserver.NameServer
- func (i *Instance) Navigator() *navigator.Navigator
- func (i *Instance) NetEnv() *netenv.NetEnv
- func (i *Instance) NetQuery() *netquery.NetQuery
- func (i *Instance) Network() *network.Network
- func (i *Instance) Notifications() *notifications.Notifications
- func (i *Instance) Patrol() *patrol.Patrol
- func (i *Instance) Process() *process.ProcessModule
- func (i *Instance) Profile() *profile.ProfileModule
- func (i *Instance) Ready() bool
- func (i *Instance) Resolver() *resolver.ResolverModule
- func (i *Instance) Restart()
- func (i *Instance) Rng() *rng.Rng
- func (i *Instance) Runtime() *runtime.Runtime
- func (i *Instance) SPNGroup() *mgr.ExtendedGroup
- func (i *Instance) SetCmdLineOperation(f func() error)
- func (i *Instance) SetSleep(enabled bool)
- func (i *Instance) Ships() *ships.Ships
- func (i *Instance) Shutdown()
- func (i *Instance) Sluice() *sluice.SluiceModule
- func (i *Instance) Start() error
- func (i *Instance) Status() *status.Status
- func (i *Instance) Stop() error
- func (i *Instance) Stopped() <-chan struct{}
- func (i *Instance) Stopping() bool
- func (i *Instance) Sync() *sync.Sync
- func (i *Instance) Terminal() *terminal.TerminalModule
- func (i *Instance) UI() *ui.UI
- func (i *Instance) Updates() *updates.Updates
- type ServiceConfig
- type SleepyModule
Constants ¶
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) 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) Broadcasts ¶
func (i *Instance) Broadcasts() *broadcasts.Broadcasts
Broadcasts returns the broadcast module.
func (*Instance) CustomList ¶
func (i *Instance) CustomList() *customlists.CustomList
CustomList returns the customlist module.
func (*Instance) FilterLists ¶
func (i *Instance) FilterLists() *filterlists.FilterLists
FilterLists returns the filterLists module.
func (*Instance) GetEventSPNConnected ¶
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) Interception ¶
func (i *Instance) Interception() *interception.Interception
Interception returns the interception module.
func (*Instance) NameServer ¶
func (i *Instance) NameServer() *nameserver.NameServer
NameServer returns the nameserver module.
func (*Instance) Notifications ¶
func (i *Instance) Notifications() *notifications.Notifications
Notifications returns the notifications 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 ¶
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) SPNGroup ¶
func (i *Instance) SPNGroup() *mgr.ExtendedGroup
SPNGroup returns the group of all SPN modules.
func (*Instance) SetCmdLineOperation ¶
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 ¶
SetSleep sets sleep mode on all modules that satisfy the SleepyModule interface.
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) Stopped ¶
func (i *Instance) Stopped() <-chan struct{}
Stopped returns a channel that is triggered when the instance has shut down.
func (*Instance) Terminal ¶
func (i *Instance) Terminal() *terminal.TerminalModule
Terminal returns the terminal 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
|
|
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. |
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. |