process

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Process service

Process service is responsible for starting, stopping and checking the status of a custom application. It uses SSH service.

Usage
  1. Starting process endly app.yaml app.yaml
init:
  appPath: $Pwd()/my-app
pipeline:
  setSdk:
    action: sdk:set
    sdk: node:12
  build:
    action: exec:run
    checkError: true
    commands:
      - cd $appPath
      - npm install
      - npm test
  stop:
    action: process:stop
    input: react-scripts/scripts/start.js

  start:
    action: process:start
    directory: $appPath/
    watch: true
    immuneToHangups: true
    command: npm start
  1. Stopping process
Service Id Action Description Request Response
process status check status of an application StatusRequest StatusResponse
process start start provided application StartRequest StartResponse
process stop kill requested application StopRequest RunResponse

Documentation

Index

Constants

View Source
const ServiceID = "process"

ServiceID represents a system process service id

Variables

This section is empty.

Functions

func New

func New() endly.Service

New creates new system process service.

Types

type Info

type Info struct {
	Name      string
	Pid       int
	Command   string
	Arguments []string
	Stdin     string
	Stdout    string
}

Info represents process info

type StartRequest

type StartRequest struct {
	Target  *location.Resource `required:"true" description:"host where process will be started"`
	Command string             `required:"true" description:"command to start process"`
	*exec.Options
	Arguments       []string
	AsSuperUser     bool
	ImmuneToHangups bool `description:"start process as nohup"`
	Watch           bool `description:"watch command output, work with nohup mode"`
}

StartRequest represents a start request

func NewStartRequestFromURL

func NewStartRequestFromURL(URL string) (*StartRequest, error)

NewStartRequestFromURL creates a new request from URL

func (*StartRequest) Init

func (r *StartRequest) Init() error

type StartResponse

type StartResponse struct {
	Command string
	Info    []*Info
	Pid     int
	Stdout  string
}

StartResponse represents a start response

type StatusRequest

type StatusRequest struct {
	Target       *location.Resource
	Command      string `` /* 133-byte string literal not displayed */
	ExactCommand bool   `description:"if this flag set do not try detect actual command but return all processes matched by command"`
}

StatusRequest represents a status check request

func NewStatusRequest

func NewStatusRequest(command string, target *location.Resource) *StatusRequest

type StatusResponse

type StatusResponse struct {
	Processes []*Info
	Pid       int
}

StatusResponse represents a status check response

type StopRequest

type StopRequest struct {
	Target *location.Resource
	Pid    int
	Input  string `description:"if specified, matches all process Pid to stop"`
}

StopRequest represents a stop request

func NewStopRequest

func NewStopRequest(pid int, target *location.Resource) *StopRequest

NewStopRequest creates a stop request

type StopResponse

type StopResponse struct {
	Stdout string
}

StopResponse represents a stop response

Jump to

Keyboard shortcuts

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