daemon

package
v0.0.0-...-d8cb2d5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package daemon handles the GRPC daemon with systemd support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSocketPath

func WithSocketPath(p string) func(o *options)

WithSocketPath uses a manual socket path instead of socket activation.

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, registerGRPCService GRPCServiceRegisterer, 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(ctx context.Context, force bool)

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 listens on a tcp socket and starts serving GRPC requests on it.

type GRPCServiceRegisterer

type GRPCServiceRegisterer func(context.Context) *grpc.Server

GRPCServiceRegisterer is a function that the daemon will call everytime we want to build a new GRPC object.

type Option

type Option func(*options)

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

Jump to

Keyboard shortcuts

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