daemons

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDaemonNotDirectChild = errors.New(
	"user daemon is not a direct child process",
)
View Source
var ErrShutdown = errors.New("shutdown")

Functions

This section is empty.

Types

type Config

type Config struct {
	IdleLifetime time.Duration
	ReapInterval time.Duration
}

type Daemon

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

func (*Daemon) Conn

func (d *Daemon) Conn() *grpc.ClientConn

func (*Daemon) Release

func (d *Daemon) Release()

type Daemons

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

func New

func New(lg Logger) *Daemons

func (*Daemons) Run

func (ds *Daemons) Run(ctx context.Context) error

func (*Daemons) Start

func (ds *Daemons) Start(
	ctx context.Context,
	key Key,
	start func(context.Context) (*Egg, error),
) (*Daemon, error)

type Egg

type Egg struct {
	Cmd       *exec.Cmd
	Conn      *grpc.ClientConn
	IsManaged bool
}

type Key

type Key string

type Logger

type Logger interface {
	Errorw(msg string, kv ...interface{})
	Infow(msg string, kv ...interface{})
}

Jump to

Keyboard shortcuts

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