elvish: github.com/elves/elvish/pkg/daemon Index | Files | Directories

package daemon

import "github.com/elves/elvish/pkg/daemon"

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.


Package Files

client.go daemon.go serve.go service.go sock_unix.go


const Version = -93

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


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")

func Serve Uses

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.

type Client Uses

type Client interface {

    ResetConn() error
    Close() error

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

Client represents a daemon client.

func NewClient Uses

func NewClient(sockPath string) Client

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


internal/apiPackage api defines types and constants useful for the API between the daemon service and client.

Package daemon imports 10 packages (graph) and is imported by 4 packages. Updated 2019-12-31. Refresh now. Tools for package owners.