daemon

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package daemon provides facilities for daemon operation.

Index

Constants

View Source
const (
	// RecommendedDialTimeout is the recommended timeout to use when connecting
	// to the daemon over IPC.
	RecommendedDialTimeout = 1 * time.Second
)
View Source
const RegistrationSupported = false

RegistrationSupported indicates whether or not daemon registration is supported on this platform.

Variables

This section is empty.

Functions

func DialTimeout

func DialTimeout(timeout time.Duration) (net.Conn, error)

DialTimeout attempts to establish a daemon IPC connection, timing out after the specified duration.

func NewListener

func NewListener() (net.Listener, error)

NewListener creates a new daemon IPC listener.

func Register

func Register() error

Register performs automatic daemon startup registration.

func RegisteredStart

func RegisteredStart() (bool, error)

RegisteredStart potentially handles daemon start operations if the daemon is registered for automatic start with the system. It returns false if the start operation was not handled and should be handled by the normal start command.

func RegisteredStop

func RegisteredStop() (bool, error)

RegisteredStop potentially handles stop start operations if the daemon is registered for automatic start with the system. It returns false if the stop operation was not handled and should be handled by the normal stop command.

func Unregister

func Unregister() error

Unregister performs automatic daemon startup de-registration.

Types

type Lock

type Lock struct {
	// contains filtered or unexported fields
}

Lock represents a daemon lock instance.

func AcquireLock

func AcquireLock() (*Lock, error)

AcquireLock attempts to acquire the daemon lock. It is the only way to acquire a Lock instance.

func (*Lock) Unlock

func (l *Lock) Unlock() error

Unlock releases the daemon lock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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