service

package
v0.0.0-...-e890a9a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// UUID returns the unique identifier of the service.
	// This should be unique per machine and across machines.
	UUID() uuid.UUID

	// Name returns the unique name of the service.
	// This should be unique per machine.
	Name() string

	// Run starts the service with the provided context.
	// It returns an error if the service needs to be restarted.
	Run(ctx context.Context) error
}

Service is an interface for long running processes or daemons. A service will be restarted if it returns an error. If a service returns nil, it is regarded to be done aka a oneshot service. Both name and UUID should be unique per machine. The UUID should be unique across machines as well as the name can be duplicate if multiple machines are connected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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