Documentation ¶
Index ¶
- Constants
- func ParsePortRange(portRange string) (int32, int32, error)
- type BinaryCommand
- type BinaryExecutor
- type Command
- type Executor
- type GRPCHealthChecker
- type HealthChecker
- type Manager
- func (pm *Manager) ProcessCreate(ctx context.Context, req *rpc.ProcessCreateRequest) (ret *rpc.ProcessResponse, err error)
- func (pm *Manager) ProcessDelete(ctx context.Context, req *rpc.ProcessDeleteRequest) (ret *rpc.ProcessResponse, err error)
- func (pm *Manager) ProcessGet(ctx context.Context, req *rpc.ProcessGetRequest) (*rpc.ProcessResponse, error)
- func (pm *Manager) ProcessList(ctx context.Context, req *rpc.ProcessListRequest) (*rpc.ProcessListResponse, error)
- func (pm *Manager) ProcessLog(req *rpc.LogRequest, srv rpc.ProcessManagerService_ProcessLogServer) error
- func (pm *Manager) ProcessReplace(ctx context.Context, req *rpc.ProcessReplaceRequest) (ret *rpc.ProcessResponse, err error)
- func (pm *Manager) ProcessWatch(req *empty.Empty, srv rpc.ProcessManagerService_ProcessWatchServer) (err error)
- func (pm *Manager) Shutdown()
- func (pm *Manager) Subscribe() (<-chan interface{}, error)
- func (pm *Manager) VersionGet(ctx context.Context, empty *empty.Empty) (*rpc.VersionResponse, error)
- type MockCommand
- type MockExecutor
- type MockHealthChecker
- type Process
- type State
Constants ¶
View Source
const ( StateStarting = State(types.ProcessStateStarting) StateRunning = State(types.ProcessStateRunning) StateStopping = State(types.ProcessStateStopping) StateStopped = State(types.ProcessStateStopped) StateError = State(types.ProcessStateError) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BinaryCommand ¶
func NewBinaryCommand ¶
func NewBinaryCommand(binary string, arg ...string) (*BinaryCommand, error)
func (*BinaryCommand) Kill ¶
func (bc *BinaryCommand) Kill()
func (*BinaryCommand) SetOutput ¶
func (bc *BinaryCommand) SetOutput(writer io.Writer)
func (*BinaryCommand) Started ¶
func (bc *BinaryCommand) Started() bool
func (*BinaryCommand) Stop ¶
func (bc *BinaryCommand) Stop()
func (*BinaryCommand) StopWithSignal ¶
func (bc *BinaryCommand) StopWithSignal(signal syscall.Signal)
type BinaryExecutor ¶
type BinaryExecutor struct{}
func (*BinaryExecutor) NewCommand ¶
func (be *BinaryExecutor) NewCommand(name string, arg ...string) (Command, error)
type GRPCHealthChecker ¶
type GRPCHealthChecker struct{}
func (*GRPCHealthChecker) IsRunning ¶
func (c *GRPCHealthChecker) IsRunning(address string) bool
func (*GRPCHealthChecker) WaitForRunning ¶
func (c *GRPCHealthChecker) WaitForRunning(address, name string, stopCh chan struct{}) bool
type HealthChecker ¶
type Manager ¶
type Manager struct { Executor Executor HealthChecker HealthChecker // contains filtered or unexported fields }
func NewManager ¶
func (*Manager) ProcessCreate ¶
func (pm *Manager) ProcessCreate(ctx context.Context, req *rpc.ProcessCreateRequest) (ret *rpc.ProcessResponse, err error)
ProcessCreate will create a process according to the request. If the specified process name exists already, the creation will fail.
func (*Manager) ProcessDelete ¶
func (pm *Manager) ProcessDelete(ctx context.Context, req *rpc.ProcessDeleteRequest) (ret *rpc.ProcessResponse, err error)
ProcessDelete will delete the process named by the request. If the process doesn't exist, the deletion will return with ErrorNotFound
func (*Manager) ProcessGet ¶
func (pm *Manager) ProcessGet(ctx context.Context, req *rpc.ProcessGetRequest) (*rpc.ProcessResponse, error)
ProcessGet will get a process named by the request. If the process doesn't exist, the call will return with ErrorNotFound
func (*Manager) ProcessList ¶
func (pm *Manager) ProcessList(ctx context.Context, req *rpc.ProcessListRequest) (*rpc.ProcessListResponse, error)
func (*Manager) ProcessLog ¶
func (pm *Manager) ProcessLog(req *rpc.LogRequest, srv rpc.ProcessManagerService_ProcessLogServer) error
func (*Manager) ProcessReplace ¶
func (pm *Manager) ProcessReplace(ctx context.Context, req *rpc.ProcessReplaceRequest) (ret *rpc.ProcessResponse, err error)
ProcessReplace will replace a process with the new process according to the request. If the specified process name doesn't exist already, the replace will fail.
func (*Manager) ProcessWatch ¶
func (*Manager) VersionGet ¶
type MockCommand ¶
type MockCommand struct { *sync.RWMutex Binary string Args []string // contains filtered or unexported fields }
func NewMockCommand ¶
func NewMockCommand(name string, arg ...string) *MockCommand
func (*MockCommand) Kill ¶
func (mc *MockCommand) Kill()
func (*MockCommand) Run ¶
func (mc *MockCommand) Run() error
func (*MockCommand) SetOutput ¶
func (mc *MockCommand) SetOutput(writer io.Writer)
func (*MockCommand) Started ¶
func (mc *MockCommand) Started() bool
func (*MockCommand) Stop ¶
func (mc *MockCommand) Stop()
func (*MockCommand) StopWithSignal ¶
func (mc *MockCommand) StopWithSignal(signal syscall.Signal)
type MockExecutor ¶
type MockExecutor struct {
CreationHook func(cmd *MockCommand) (*MockCommand, error)
}
func (*MockExecutor) NewCommand ¶
func (me *MockExecutor) NewCommand(name string, arg ...string) (Command, error)
type MockHealthChecker ¶
type MockHealthChecker struct{}
func (*MockHealthChecker) IsRunning ¶
func (c *MockHealthChecker) IsRunning(address string) bool
func (*MockHealthChecker) WaitForRunning ¶
func (c *MockHealthChecker) WaitForRunning(address, name string, stopCh chan struct{}) bool
type Process ¶
type Process struct { Name string Binary string Args []string PortCount int32 PortArgs []string UUID string State State ErrorMsg string PortStart int32 PortEnd int32 UpdateCh chan *Process // contains filtered or unexported fields }
func (*Process) RPCResponse ¶
func (p *Process) RPCResponse() *rpc.ProcessResponse
func (*Process) StopWithSignal ¶
Click to show internal directories.
Click to hide internal directories.