daemon

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 10 Imported by: 0

README

Build Status Go Report

Go Daemon

Lightweight dependency-free Go daemon handler for Linux

Documentation

Index

Constants

View Source
const DEBUG = false

DEBUG flag

View Source
const Version = "1.7.0"

Version export

Variables

This section is empty.

Functions

func Config

func Config(debug bool, logger *oslog.Logger)

Config export

func Logger

func Logger() *oslog.Logger

Logger returns configred *os.Logger

func ProcessInfoNameImpl

func ProcessInfoNameImpl(pid int) string

ProcessInfoNameImpl export

func Syslogger

func Syslogger(procname string) *oslog.Logger

Syslogger returns a configred *os.Logger logging to syslogd

Types

type Daemon

type Daemon struct {
}

Daemon type

func NewDaemon

func NewDaemon() *Daemon

NewDaemon init

func (*Daemon) Main

func (id *Daemon) Main()

Main export

type PidFile

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

PidFile type

func NewPidFile

func NewPidFile() *PidFile

NewPidFile init

type ProcessInfo

type ProcessInfo struct {
	Pid       int
	ParentPid int
	Name      string
	FullName  string
	Path      string
}

ProcessInfo export

func NewProcessInfoCurrent

func NewProcessInfoCurrent() *ProcessInfo

NewProcessInfoCurrent current

func NewProcessInfoPid

func NewProcessInfoPid(pid int) *ProcessInfo

NewProcessInfoPid export

func (*ProcessInfo) FullPath

func (id *ProcessInfo) FullPath() string

FullPath export

func (*ProcessInfo) IsCurrent

func (id *ProcessInfo) IsCurrent() bool

IsCurrent export

func (*ProcessInfo) IsDaemon

func (id *ProcessInfo) IsDaemon() bool

IsDaemon determines if the current process qualifies as a daemon

func (*ProcessInfo) IsForkOf

func (id *ProcessInfo) IsForkOf(parent *ProcessInfo) bool

IsForkOf export

func (*ProcessInfo) Parent

func (id *ProcessInfo) Parent() *ProcessInfo

Parent export

func (*ProcessInfo) Process

func (id *ProcessInfo) Process() *os.Process

Process returns *os.resolveProcess if the process is running, otherwise nil

func (*ProcessInfo) RestartParent

func (id *ProcessInfo) RestartParent(updatePath string)

RestartParent export

Jump to

Keyboard shortcuts

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