Giter Site home page Giter Site logo

pmgo's Introduction

PMGO

PMGO is a lightweight process manager written in Golang for Golang applications. It helps you keep your applications alive forever, reload and start them from the source code.

Change log(2020-06-27 updated)

Change log

Install pmgo

$ go get github.com/struCoder/pmgo
$ mv $GOPATH/bin/pmgo /usr/local/bin

Or

git clone https://github.com/struCoder/pmgo.git
cd path/to/struCoder/pmgo
go build -v pmgo.go
mv pmgo /usr/local/bin

Starting a new application

If it's the first time you are starting a new golang application, you need to tell pmgo to first build its binary. Then you need to first run:

$ pmgo start path/to/source-directory app-name

This will automatically compile, start and daemonize your application. If you need to later on, stop, restart or delete your app from PMGO, you can just run normal commands using the app-name you specified. Example:

$ pmgo stop app-name
$ pmgo restart app-name
$ pmgo delete app-name

Main features

Commands overview

$ pmgo kill                                                  # kill pmgo daemon process

$ pmgo start source app-name                                 # Compile, start, daemonize and auto  restart application.
$ pmgo restart app-name                                      # Restart a previously saved process
$ pmgo stop app-name                                         # Stop application.
$ pmgo delete app-name                                       # Delete application forever.

$ pmgo save                                                  # Save current process list

$ pmgo list                                                  # Display status for each app.
$ pmgo info app-name                                         # describe importance parameters of a process name

Start your GO-application with parameters

// pmgo will build your source code folder under $GOPATH/src by default
// Here my tmp folder was: $GOPATH/src/tmp
pmgo start tmp/ test --args "arg1 arg2 arg3"

# In your application
fmt.Println(os.Args[1:])
# Output: [arg1, arg2, arg3]

Start application from user input compiled binary

# true means use user input compiled binary path
pmgo start /Users/strucoder/personalPro/goplace/main awesome_name true --args="arg1 arg2 arg3"

Demo

demo

I Love This. How do I Help?

  • Simply star this repository :-)
  • Help us spread the world on Facebook and Twitter
  • Contribute Code!
  • I'll be very grateful if you'd like to donate to encourage me to continue maintaining pmgo.

Contributors

Donate

Paypal Alipay
paypal alipay

By The Way

In China Mainland, maybe you can't download some packages in golang.org, thus just click here to set GOPROXY

LICENSE

MIT

pmgo's People

Contributors

felipejfc avatar helloworldpark avatar hysios avatar jj avatar mateusdantas avatar strucoder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.