daemon

package
v0.0.0-...-4f20386 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package daemon handles the dbus daemon with systemd support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon is a grpc daemon with systemd support.

func New

func New(ctx context.Context, service Service, args ...Option) (d *Daemon, err error)

New returns an new, initialized daemon server, which handles systemd activation. If systemd activation is used, it will override any socket passed here.

func (Daemon) Quit

func (d Daemon) Quit()

Quit gracefully quits listening loop and stops the grpc server. It can drops any existing connexion is force is true.

func (*Daemon) Serve

func (d *Daemon) Serve(ctx context.Context) (err error)

Serve signals systemd that we are ready to receive from the service.

type Option

type Option func(*options)

Option is the function signature used to tweak the daemon creation.

type Service

type Service interface {
	Addr() string
	Serve() error
	Stop() error
}

Service is a server that can Serve and be Stopped by our daemon.

Jump to

Keyboard shortcuts

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