Documentation ¶
Index ¶
- Constants
- func NewKernelStub(config Gaffer) (rpc.GafferKernelStub, error)
- func NewService(src rpc.GafferService, instances uint32) *service
- func NewServiceEx(path, user, group string, args []string) *service
- type Event
- type Gaffer
- type GafferKernel
- type Kernel
- type Process
- func (this *Process) ExitCode() int64
- func (this *Process) Id() uint32
- func (this *Process) Pid() uint32
- func (this *Process) Service() rpc.GafferService
- func (this *Process) Start(out chan<- *Event) error
- func (this *Process) State() rpc.GafferState
- func (this *Process) Stop() error
- func (this *Process) String() string
- func (this *Process) Timestamp() time.Time
Constants ¶
View Source
const ( R_OK = 4 W_OK = 2 X_OK = 1 )
View Source
const ( // Time to look for new services DURATION_DISCOVER = 20 * time.Second // Time to update process state DURATION_PROCESS = 5 * time.Second )
View Source
const (
BUF_MAX_SIZE = 1024
)
View Source
const ( // Time to look to prune new and stopped processes DURATION_PRUNE = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func NewKernelStub ¶
func NewKernelStub(config Gaffer) (rpc.GafferKernelStub, error)
func NewService ¶
func NewService(src rpc.GafferService, instances uint32) *service
func NewServiceEx ¶
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func NewBufferEvent ¶
func NewBufferEvent(process rpc.GafferProcess, buf []byte, t rpc.GafferState) *Event
func NewRunningEvent ¶
func NewRunningEvent(process rpc.GafferProcess) *Event
func NewStoppedEvent ¶
func NewStoppedEvent(process rpc.GafferProcess, err error) *Event
func (*Event) Process ¶
func (this *Event) Process() rpc.GafferProcess
func (*Event) State ¶
func (this *Event) State() rpc.GafferState
type Gaffer ¶
type GafferKernel ¶
type GafferKernel interface { gopi.PubSub // CreateProcess creates a new process, which is ready to run and returns // a unique id for that process CreateProcess(rpc.GafferService) (uint32, error) // Extended version of create process CreateProcessEx(uint32, rpc.GafferService, time.Duration) (uint32, error) // RunProcess starts a process in NEW state RunProcess(uint32) error // StopProcess kills a process in RUNNING state StopProcess(uint32) error // Processes returns a list of running processes, filtered optionally by // process id and service id, both can be zero for 'any' Processes(uint32, uint32) []rpc.GafferProcess // Return a list of executables under the gaffer root, or returns // an empty list if the gaffer root is not defined. When argument // is set to true, then recurse into subfolders Executables(bool) []string }
Kernel operations
type Process ¶
func NewProcess ¶
NewProcess returns a new process object which is used to control processes
func (*Process) Service ¶
func (this *Process) Service() rpc.GafferService
func (*Process) State ¶
func (this *Process) State() rpc.GafferState
Click to show internal directories.
Click to hide internal directories.