Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultConf(conf, prefix, name string) string
- func DefaultCtl(ctl, prefix, name string) string
- func NewRPCServer(m *Manager) *rpc.Server
- func Prefix(prefix string) string
- type API
- type Action
- type ByteCount
- type Event
- type Info
- type InfoAction
- type InfoQuery
- type InfoReply
- type KillAction
- type KillQuery
- type KillReply
- type Manager
- type PrefixReader
- type Process
- type ProcessConfig
- type ProcessExitEvent
- type ProcessInfo
- type ProcessQuery
- type ProcessReadyEvent
- type ProcessState
- type PsAction
- type PsQuery
- type PsReply
- type ShutdownAction
- type StartAction
- type StartQuery
- type StartReply
- type TimeoutTracker
Constants ¶
View Source
const ( PROCESS_STARTING = ProcessState(1 << iota) PROCESS_READY = ProcessState(1 << iota) PROCESS_STOPPING = ProcessState(1 << iota) )
View Source
const DEFAULT_PREFIX = "/var/crank"
View Source
const VERSION = "0.1.4"
Variables ¶
View Source
var DefaultConfig = &ProcessConfig{ Cwd: "", Command: []string{}, StartTimeout: time.Second * 30, StopTimeout: time.Second * 30, }
View Source
var EMPTY_BYTES = []byte{}
View Source
var EmptyProcessSet = make(processSet)
Functions ¶
func DefaultConf ¶
func DefaultCtl ¶
func NewRPCServer ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Run ¶
func (self *API) Run(query *StartQuery, reply *StartReply) error
type InfoAction ¶
type InfoAction struct {
// contains filtered or unexported fields
}
type KillAction ¶
type KillAction struct {
// contains filtered or unexported fields
}
type KillQuery ¶
type KillQuery struct { ProcessQuery Signal string Wait bool }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages multiple process groups
func (*Manager) Reload ¶
func (self *Manager) Reload()
Restart queues and starts excecuting a restart job to replace the old process group with a new one.
func (*Manager) SendAction ¶
type PrefixReader ¶
type PrefixReader struct {
// contains filtered or unexported fields
}
func NewLinePrefixer ¶
func NewLinePrefixer(r io.Reader, prefix func() string) *PrefixReader
type ProcessConfig ¶
type ProcessConfig struct { Cwd string `json:"cwd"` Command []string `json:"command"` StartTimeout time.Duration `json:"start_timeout"` StopTimeout time.Duration `json:"stop_timeout"` }
func (*ProcessConfig) String ¶
func (self *ProcessConfig) String() string
type ProcessExitEvent ¶
type ProcessExitEvent struct {
// contains filtered or unexported fields
}
type ProcessInfo ¶
func (*ProcessInfo) String ¶
func (pi *ProcessInfo) String() string
type ProcessQuery ¶
Used by other query structs
type ProcessReadyEvent ¶
type ProcessReadyEvent struct {
// contains filtered or unexported fields
}
type ProcessState ¶
type ProcessState int
func (ProcessState) String ¶
func (ps ProcessState) String() string
type PsQuery ¶
type PsQuery struct {
ProcessQuery
}
type PsReply ¶
type PsReply struct {
PS []*ProcessInfo
}
type ShutdownAction ¶
type ShutdownAction bool
type StartAction ¶
type StartAction struct {
// contains filtered or unexported fields
}
type StartQuery ¶
type StartReply ¶
type StartReply struct {
Code int
}
type TimeoutTracker ¶
type TimeoutTracker struct {
// contains filtered or unexported fields
}
func NewTimeoutTracker ¶
func NewTimeoutTracker() *TimeoutTracker
func (*TimeoutTracker) Remove ¶
func (self *TimeoutTracker) Remove(p *Process)
func (*TimeoutTracker) Run ¶
func (self *TimeoutTracker) Run()
func (*TimeoutTracker) Stop ¶
func (self *TimeoutTracker) Stop()
Click to show internal directories.
Click to hide internal directories.