ps

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 8 Imported by: 10

Documentation

Overview

Package ps is processes

Index

Constants

This section is empty.

Variables

View Source
var (
	NameINIT      = Name("init")
	EmptyPINIT    = NewP(EmptyFunc, EmptyFunc)
	EmptyFunc     = func(ctx context.Context) (context.Context, error) { return ctx, nil }
	ErrIgnoreLeft = util.NewError("ignore left")
)

Functions

This section is empty.

Types

type Func

type Func func(context.Context) (context.Context, error)

type Name

type Name string

func (Name) String

func (p Name) String() string

type P

type P struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func NewP

func NewP(run, closef Func, requires ...Name) *P

func (*P) Close

func (p *P) Close(ctx context.Context) (context.Context, error)

func (*P) CopyHooks

func (p *P) CopyHooks(b *P)

func (*P) PostAdd

func (p *P) PostAdd(name Name, i Func) bool

func (*P) PostAddOK

func (p *P) PostAddOK(name Name, i Func) *P

func (*P) PostAfter

func (p *P) PostAfter(name Name, i Func, after Name) bool

func (*P) PostAfterOK

func (p *P) PostAfterOK(name Name, i Func, after Name) *P

func (*P) PostBefore

func (p *P) PostBefore(name Name, i Func, before Name) bool

func (*P) PostBeforeOK

func (p *P) PostBeforeOK(name Name, i Func, before Name) *P

func (*P) PostRemove

func (p *P) PostRemove(name Name) bool

func (*P) PostRemoveOK

func (p *P) PostRemoveOK(name Name) *P

func (*P) PreAdd

func (p *P) PreAdd(name Name, i Func) bool

func (*P) PreAddOK

func (p *P) PreAddOK(name Name, i Func) *P

func (*P) PreAfter

func (p *P) PreAfter(name Name, i Func, after Name) bool

func (*P) PreAfterOK

func (p *P) PreAfterOK(name Name, i Func, after Name) *P

func (*P) PreBefore

func (p *P) PreBefore(name Name, i Func, before Name) bool

func (*P) PreBeforeOK

func (p *P) PreBeforeOK(name Name, i Func, before Name) *P

func (*P) PreRemove

func (p *P) PreRemove(name Name) bool

func (*P) PreRemoveOK

func (p *P) PreRemoveOK(name Name) *P

func (*P) Requires

func (p *P) Requires() []Name

func (*P) Run

func (p *P) Run(ctx context.Context) (context.Context, error)

func (*P) SetLogging

func (p *P) SetLogging(l *logging.Logging) *logging.Logging

func (*P) Verbose

func (p *P) Verbose(name Name) []Name

type PS

type PS struct {
	*logging.Logging

	sync.Mutex
	// contains filtered or unexported fields
}

func NewPS

func NewPS(name string) *PS

func (*PS) Add

func (ps *PS) Add(name Name, run, close Func, requires ...Name) bool

func (*PS) AddOK

func (ps *PS) AddOK(name Name, run, close Func, requires ...Name) *PS

func (*PS) AddP

func (ps *PS) AddP(name Name, p *P) bool

func (*PS) Close

func (ps *PS) Close(ctx context.Context) (context.Context, error)

func (*PS) CloseVerbose

func (ps *PS) CloseVerbose() []Name

func (*PS) P

func (ps *PS) P(name Name) (*P, bool)

func (*PS) POK

func (ps *PS) POK(name Name) *P

func (*PS) Remove

func (ps *PS) Remove(name Name) bool

func (*PS) RemoveOK

func (ps *PS) RemoveOK(name Name) *PS

func (*PS) Replace

func (ps *PS) Replace(name Name, run, close Func, requires ...Name) bool

func (*PS) ReplaceOK

func (ps *PS) ReplaceOK(name Name, run, close Func, requires ...Name) *PS

func (*PS) Run

func (ps *PS) Run(ctx context.Context) (context.Context, error)

func (*PS) SetLogging

func (ps *PS) SetLogging(l *logging.Logging) *logging.Logging

func (*PS) Verbose

func (ps *PS) Verbose() []Name

Jump to

Keyboard shortcuts

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