daemon

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: BSD-2-Clause Imports: 10 Imported by: 0

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

View Source
const Version = -93

Version is the API version. It should be bumped any time the API changes.

Variables

View Source
var (
	// ErrClientNotInitialized is returned when the Client is not initialized.
	ErrClientNotInitialized = errors.New("client not initialized")
	// ErrDaemonUnreachable is returned when the daemon cannot be reached after
	// several retries.
	ErrDaemonUnreachable = errors.New("daemon offline")
)

Functions

func Serve

func Serve(sockpath, dbpath string)

Serve runs the daemon service, listening on the socket specified by sockpath and serving data from dbpath. It quits upon receiving SIGTERM, SIGINT or when all active clients have disconnected.

Types

type Client

type Client interface {
	store.Store

	ResetConn() error
	Close() error

	Pid() (int, error)
	SockPath() string
	Version() (int, error)
}

Client represents a daemon client.

func NewClient

func NewClient(sockPath string) Client

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

Directories

Path Synopsis
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