proc

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	StartAction = "start"
	RunAction   = "run"
	StopAction  = "stop"

	RestartExisting ProcStartPolicy = iota
	ReuseExisting
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitoredProc

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

func (*MonitoredProc) Monitor

func (p *MonitoredProc) Monitor(logName string)

func (*MonitoredProc) Stop

func (p *MonitoredProc) Stop(mon bool) error

type ProcManager

type ProcManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(executor exec.Executor) *ProcManager

Create a new proc manager

func (*ProcManager) Run

func (p *ProcManager) Run(logName, command string, args ...string) error

Start a child process and wait for its completion

func (*ProcManager) RunWithCombinedOutput added in v0.3.0

func (p *ProcManager) RunWithCombinedOutput(logName, command string, args ...string) (string, error)

Start a child process and wait for its completion

func (*ProcManager) RunWithOutput added in v0.1.1

func (p *ProcManager) RunWithOutput(logName, command string, args ...string) (string, error)

Start a child process and wait for its completion

func (*ProcManager) Shutdown

func (p *ProcManager) Shutdown()

func (*ProcManager) Start

func (p *ProcManager) Start(name, command, procSearchPattern string, policy ProcStartPolicy, args ...string) (*MonitoredProc, error)

Start the given process with the provided arguments. Handling of any matching existing process will be in accordance with the given ProcStartPolicy. The search pattern will be used to search through the cmdline args of existing processes to find any matching existing process. Therefore, it should be a regex pattern that can uniquely identify the process (e.g., --id=1)

type ProcStartPolicy

type ProcStartPolicy int

Jump to

Keyboard shortcuts

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