Documentation ¶
Index ¶
- Constants
- type Instance
- func (i *Instance) API() *api.API
- func (i *Instance) Access() *access.Access
- func (i *Instance) AddModule(m mgr.Module)
- func (i *Instance) AddStatesCallback(callbackName string, callback mgr.EventCallbackFunc[mgr.StateUpdate])
- func (i *Instance) Base() *base.Base
- func (i *Instance) Cabin() *cabin.Cabin
- func (i *Instance) Captain() *captain.Captain
- 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) Database() *dbmodule.DBModule
- func (i *Instance) Docks() *docks.Docks
- func (i *Instance) ExitCode() int
- func (i *Instance) FilterLists() *filterlists.FilterLists
- func (i *Instance) GeoIP() *geoip.GeoIP
- func (i *Instance) GetEventSPNConnected() *mgr.EventMgr[struct{}]
- func (i *Instance) GetStates() []mgr.StateUpdate
- func (i *Instance) Metrics() *metrics.Metrics
- func (i *Instance) Navigator() *navigator.Navigator
- func (i *Instance) NetEnv() *netenv.NetEnv
- func (i *Instance) Notifications() *notifications.Notifications
- func (i *Instance) Patrol() *patrol.Patrol
- func (i *Instance) Ready() bool
- 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) Stop() error
- func (i *Instance) Stopped() <-chan struct{}
- func (i *Instance) Stopping() bool
- func (i *Instance) Terminal() *terminal.TerminalModule
- func (i *Instance) Updates() *updates.Updates
- 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 { CommandLineOperation func() error // contains filtered or unexported fields }
Instance is an instance of a Portmaster service.
func (*Instance) AddModule ¶
AddModule validates the given module and adds it to the service group, if all requirements are met. All modules must be added before anything is done with the 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) 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) Notifications ¶
func (i *Instance) Notifications() *notifications.Notifications
Notifications returns nil.
func (*Instance) Ready ¶
Ready returns whether all modules in the main service module group have been started and are still running.
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 fakes interface conformance. SPNGroup is only needed on SPN clients.
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 SleepyModule ¶
type SleepyModule interface {
SetSleep(enabled bool)
}
SleepyModule is an interface for modules that can enter some sort of sleep mode.
Directories ¶
Path | Synopsis |
---|---|
Package unit provides a "work unit" scheduling system for handling data sets that traverse multiple workers / goroutines.
|
Package unit provides a "work unit" scheduling system for handling data sets that traverse multiple workers / goroutines. |