<commit_before>golet
=====
I made golet based on the idea of [Proclet](https://metacpan.org/pod/Proclet).  
Proclet is great module in Perl.  

# Synopsis
```go
package main

import (
	"context"
	"fmt"
	"io"
	"os"
	"time"

	"github.com/Code-Hex/golet"
)

func main() {
	p := golet.New(context.Background())
	p.EnableColor()
	// Execcution interval
	p.SetInterval(time.Second * 1)

	p.Env(map[string]string{
		"NAME":  "codehex",
		"VALUE": "121",
	})

	p.Add(
		golet.Service{
			Exec: "ping google.com",
			Tag:  "ping",
		},
		golet.Service{
			Exec:   "echo 'Worker is 2!! PORT: $PORT'",
			Every:  "30 * * * * *",
			Worker: 2,
			Tag:    "echo",
		},
	)

	p.Add(golet.Service{
		Code: func(w io.Writer, port int) error {
			fmt.Fprintln(w, "Hello golet!! Port:", port)
			fmt.Fprintln(w, os.Getenv("NAME"), os.Getenv("VALUE"))
			return nil
		},
		Worker: 3,
		Every:  "@every 10s",
	})

	p.Run()
}
```

# Description
Golet is minimalistic Supervisor like Proclet, fork and manage many services from one golang program.

# Logging
In case to run code of synopsis.
![Logging](https://cloud.githubusercontent.com/assets/6500104/22722641/efd64978-edfb-11e6-8f21-3d44e0ea7f52.png)

# Usage
## Basic
Make sure to generate a struct from the `New(context.Context)` function.  
```go
p := golet.New(context.Background())
```
Next, We can add the service using the `Service` struct.  <commit_msg>Modified README<commit_after>golet
=====
golet is minimalistic Supervisor, fork and manage many services from one golang program.  
It is based on the idea of [Proclet](https://metacpan.org/pod/Proclet).  
Proclet is great module in Perl.  

# Synopsis
```go
package main

import (
	"context"
	"fmt"
	"io"
	"os"
	"time"

	"github.com/Code-Hex/golet"
)

func main() {
	p := golet.New(context.Background())
	p.EnableColor()
	// Execcution interval
	p.SetInterval(time.Second * 1)

	p.Env(map[string]string{
		"NAME":  "codehex",
		"VALUE": "121",
	})

	p.Add(
		golet.Service{
			Exec: "ping google.com",
			Tag:  "ping",
		},
		golet.Service{
			Exec:   "echo 'Worker is 2!! PORT: $PORT'",
			Every:  "30 * * * * *",
			Worker: 2,
			Tag:    "echo",
		},
	)

	p.Add(golet.Service{
		Code: func(w io.Writer, port int) error {
			fmt.Fprintln(w, "Hello golet!! Port:", port)
			fmt.Fprintln(w, os.Getenv("NAME"), os.Getenv("VALUE"))
			return nil
		},
		Worker: 3,
		Every:  "@every 10s",
	})

	p.Run()
}
```

# Logging
In case to run code of synopsis.
![Logging](https://cloud.githubusercontent.com/assets/6500104/22722641/efd64978-edfb-11e6-8f21-3d44e0ea7f52.png)

# Usage
## Basic
Make sure to generate a struct from the `New(context.Context)` function.  
```go
p := golet.New(context.Background())
```
Next, We can add the service using the `Service` struct.  
{'fraction_non_alphanumeric': 0.16745368688703233, 'fraction_numerical': 0.03196512895023611, 'mean_word_length': 3.5296052631578947, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '691786', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1070, 'n_words': 267}