daemon

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: BSD-2-Clause Imports: 20 Imported by: 1

Documentation

Overview

Package daemon implements a service for mediating access to the data store, and its client.

Most RPCs exposed by the service correspond to the methods of Store in the store package and are not documented here.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDaemonUnreachable is returned when the daemon cannot be reached after
	// several retries.
	ErrDaemonUnreachable = errors.New("daemon offline")
)
View Source
var Program prog.Program = program{}

Program is the daemon subprogram.

Functions

func Activate added in v0.17.0

func Activate(stderr io.Writer, spawnCfg *daemondefs.SpawnConfig) (daemondefs.Client, error)

Activate returns a daemon client, either by connecting to an existing daemon, or spawning a new one. It always returns a non-nil client, even if there was an error.

func NewClient added in v0.17.0

func NewClient(sockPath string) daemondefs.Client

NewClient creates a new Client instance that talks to the socket. Connection creation is deferred to the first request.

func Serve

func Serve(sockpath, dbpath string, opts ServeOpts) int

Serve runs the daemon service, listening on the socket specified by sockpath and serving data from dbpath until all clients have exited. See doc for ServeChans for additional options.

Types

type ServeOpts added in v0.17.0

type ServeOpts struct {
	// If not nil, will be closed when the daemon is ready to serve requests.
	Ready chan<- struct{}
	// Causes the daemon to abort if closed or sent any date. If nil, Serve will
	// set up its own signal channel by listening to SIGINT and SIGTERM.
	Signals <-chan os.Signal
	// If not nil, overrides the response of the Version RPC.
	Version *int
}

ServeOpts keeps options that can be passed to Serve.

Directories

Path Synopsis
Package daemondefs contains definitions used for the daemon.
Package daemondefs contains definitions used for the daemon.
internal
api
Package api defines types and constants useful for the API between the daemon service and client.
Package api defines types and constants useful for the API between the daemon service and client.

Jump to

Keyboard shortcuts

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