Documentation
¶
Index ¶
- Constants
- Variables
- type ServiceSource
- func (s *ServiceSource) Contexts() []string
- func (bc *ServiceSource) Find(ctx context.Context, itemContext string) ([]*sdp.Item, error)
- func (bc *ServiceSource) Get(ctx context.Context, itemContext string, query string) (*sdp.Item, error)
- func (bc *ServiceSource) Name() string
- func (bc *ServiceSource) Search(ctx context.Context, itemContext string, query string) ([]*sdp.Item, error)
- func (bc *ServiceSource) Supported() bool
- func (bc *ServiceSource) Type() string
- func (s *ServiceSource) Weight() int
Constants ¶
const DEFAULT_TIMEOUT = (10 * time.Second)
DEFAULT_TIMEOUT Default DBUS query timeout
Variables ¶
var ServiceBasicProperties = []string{
"BusName",
"ExecCondition",
"ExecMainPID",
"FileDescriptorStoreMax",
"GuessMainPID",
"MemoryCurrent",
"NonBlocking",
"NotifyAccess",
"OOMPolicy",
"PIDFile",
"RemainAfterExit",
"Restart",
"RestartSec",
"RootDirectoryStartOnly",
"RuntimeMaxSec",
"Sockets",
"TimeoutAbortSec",
"TimeoutSec",
"TimeoutStartFailureMode",
"TimeoutStartSec",
"TimeoutStopSec",
"Type",
"USBFunctionDescriptors",
"USBFunctionStrings",
"WatchdogSec",
}
ServiceBasicProperties The list of properties to include if they are non-zero. The "basic" properties have simple values types that can be compared easily to their zero values
var ServiceExecProperties = []string{
"ExecCondition",
"ExecReload",
"ExecStart",
"ExecStartPre",
"ExecStop",
"ExecStopPost",
}
ServiceExecProperties A list of properties that contain commands to execute. These are stored as [][]interface{} and need special logic to extract
var ServiceStatusProperties = []string{
"RestartForceExitStatus",
"RestartPreventExitStatus",
"SuccessExitStatus",
}
ServiceStatusProperties Properties that list exit statuses which need special logic
Functions ¶
This section is empty.
Types ¶
type ServiceSource ¶
ServiceSource struct on which all methods are registered
func (*ServiceSource) Contexts ¶
func (s *ServiceSource) Contexts() []string
List of contexts that this source is capable of find items for
func (*ServiceSource) Find ¶
Find Gets information about all item that the source can possibly find. If nothing is found then just return an empty list (Required)
func (*ServiceSource) Get ¶
func (bc *ServiceSource) Get(ctx context.Context, itemContext string, query string) (*sdp.Item, error)
Get takes the UniqueAttribute value as a parameter (also referred to as the "name" of the item) and returns a full item will all details. This function must return an item whose UniqueAttribute value exactly matches the supplied parameter. If the item cannot be found it should return an ItemNotFoundError (Required)
func (*ServiceSource) Name ¶
func (bc *ServiceSource) Name() string
Name Returns the name of the backend package. This is used for debugging and logging (Required)
func (*ServiceSource) Search ¶
func (bc *ServiceSource) Search(ctx context.Context, itemContext string, query string) ([]*sdp.Item, error)
Search searches by a glob pattern, but also appends the following default glob patterns:
- {input}.*
If the query is an integer, it will be converted to the name of the units which owns a process with that PID
func (*ServiceSource) Supported ¶
func (bc *ServiceSource) Supported() bool
Supported A function that can be executed to see if the backend is supported in the current environment, if it returns false the backend simply won't be loaded (Optional)
func (*ServiceSource) Type ¶
func (bc *ServiceSource) Type() string
Type is the type of items that this returns (Required)