Skip to content

loganmac/process

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Process

A simple external process manager for go. Create a processor by creating a Driver, and calling process.New(driver) with your driver.

Then call processor.Run(taskName, cmd, args...) to run external commands with the processor.

Will execute the process, initializing your driver with the task name, and respond to stdoud, stderr, and exit from the process.

Works on Unix and Windows (though the example in the folder is specific to Unix)

Example

import "github.com/loganmac/process"

func main() {
  driver := &Summarizer{} // something that implements process.Driver
  processor := process.New(driver)
  if err := processor.Run("list all files", "ls", "l", "a", "h"); err != nil{
    log.Fatal(err)
  }
}

For a more complex example, see the example folder.

It shows how to use this library (and some others) to build this:

example-gif

About

An external process manager for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published