sys

package
v0.0.0-...-9576346 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestartService

func RestartService(unit string) error

RestartService restarts a service. If the service isn't already running it will be started.

func TryRestartService

func TryRestartService(unit string) error

TryRestartService will restart a service, but only if it's currently running. A service that isn't running won't be affected.

func WatchDBusSignal

func WatchDBusSignal(ctx context.Context, iface, objPath string, handlerFunc func(s *dbus.Signal))

func WatchFileChange

func WatchFileChange(ctx context.Context, handler FSNotifyHandler, monitorTargets []string)

Types

type FSNotifyHandler

type FSNotifyHandler interface {
	Notify(event fsnotify.Event)
}

func AnyOf

func AnyOf(nextHandler FSNotifyHandler, op fsnotify.Op, ops ...fsnotify.Op) FSNotifyHandler

AnyOf propagates the fsnotify Event to the next FSNotifyHandler only if the event type is one of the specified fsnotify Ops.

type FSNotifyHandlerFunc

type FSNotifyHandlerFunc func(event fsnotify.Event)

FSNotifyHandlerFunc is a callback for fsnotify Events.

func (FSNotifyHandlerFunc) Notify

func (f FSNotifyHandlerFunc) Notify(event fsnotify.Event)

Jump to

Keyboard shortcuts

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