runnerd

package module
v0.0.0-...-9574ffd Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

README

Runnerd

Runs and manages processes. Nothing to see here yet.

Documentation

Index

Constants

View Source
const (
	MSG_OUT = iota
	MSG_STDERR
	MSG_EXIT
	PIPE_STDERR
	PIPE_STDOUT
)
View Source
const (
	STOPPED  = iota
	STARTING = iota
	RUNNING  = iota
	BACKOFF  = iota
	STOPPING = iota
	EXITED   = iota
	FATAL    = iota
	UNKNOWN  = iota
)
View Source
const (
	CMD_START = iota
	CMD_STOP
	RESP_SUCCESS
	RESP_FAIL
)

Variables

This section is empty.

Functions

func StartService

func StartService(r *Runner)

Types

type Client

type Client struct {
	Rpc *rpc.Client
}

func NewClient

func NewClient(port int) (*Client, error)

func (*Client) Info

func (c *Client) Info() (*Response, error)

func (*Client) Ping

func (c *Client) Ping() (*Response, error)

func (*Client) Request

func (c *Client) Request(method string, args ...string) (*Response, error)

type Config

type Config struct {
	Ps []*ProcessConfig
}

type ExitMessage

type ExitMessage struct {
	ProcessState *os.ProcessState
}

func (*ExitMessage) Type

func (m *ExitMessage) Type() int

type Message

type Message interface {
	Type() int
}

type PipeMessage

type PipeMessage struct {
	Body   []byte
	Stream int
}

func (*PipeMessage) Type

func (m *PipeMessage) Type() int

type Process

type Process struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

func NewProcess

func NewProcess(conf *ProcessConfig, master *ProcessLauncher) *Process

func (*Process) Run

func (p *Process) Run()

func (*Process) State

func (p *Process) State()

type ProcessConfig

type ProcessConfig struct {
	Name     string
	Command  string
	Pwd      string
	Umask    int
	Priority int
}

type ProcessLauncher

type ProcessLauncher struct {
	Feedback chan Message
}

func NewProcessLauncher

func NewProcessLauncher() *ProcessLauncher

func (*ProcessLauncher) Launch

func (m *ProcessLauncher) Launch(conf *ProcessConfig) (*Process, error)

type Request

type Request struct {
	Args []string
}

type Response

type Response struct {
	Status  int
	Message string
}

type Runner

type Runner struct {
	Ps []*Process
}

type Service

type Service struct {
	Config ServiceConfig
	Runner *Runner
}

func (*Service) Info

func (s *Service) Info(r *Request, w *Response) error

func (*Service) Ping

func (s *Service) Ping(r *Request, w *Response) error

type ServiceConfig

type ServiceConfig struct {
	Host string
	Port int
}

func (*ServiceConfig) HostPort

func (sc *ServiceConfig) HostPort() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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