-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2c4d93
commit 680650a
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.PHONY: default | ||
default: | ||
mkdir -p ./bin | ||
go build -o ./bin/terjang ./cmd/terjang/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# terjang | ||
# Terjang | ||
Scalable HTTP load testing tool built on Vegeta | ||
|
||
|
||
## Build | ||
|
||
```bash | ||
make | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
cli "github.com/urfave/cli/v2" | ||
) | ||
|
||
func main() { | ||
app := getCliApp() | ||
|
||
err := app.Run(os.Args) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} | ||
|
||
func getCliApp() *cli.App { | ||
return &cli.App{ | ||
Name: "Terjang", | ||
Usage: "A scalable HTTP load testing tool built on Vegeta.", | ||
Commands: []*cli.Command{ | ||
{ | ||
Name: "server", | ||
Usage: "Run server", | ||
Flags: []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "host", | ||
Usage: "Host address to listen on", | ||
Value: "0.0.0.0", | ||
}, | ||
&cli.StringFlag{ | ||
Name: "port", | ||
Usage: "Host port to listen on", | ||
Value: "9009", | ||
}, | ||
}, | ||
Action: func(c *cli.Context) error { | ||
host := c.String("host") | ||
port := c.String("port") | ||
|
||
fmt.Printf("Server is listening on %s:%s\n", host, port) | ||
|
||
return nil | ||
}, | ||
}, | ||
{ | ||
Name: "worker", | ||
Usage: "Run worker", | ||
Flags: []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "name", | ||
Usage: "name of the worker", | ||
DefaultText: "hostname", | ||
}, | ||
&cli.StringFlag{ | ||
Name: "host", | ||
Usage: "Sever's host address to connect to", | ||
Value: "localhost", | ||
}, | ||
&cli.StringFlag{ | ||
Name: "port", | ||
Usage: "Server's host port to connect to", | ||
Value: "9009", | ||
}, | ||
}, | ||
Action: func(c *cli.Context) error { | ||
host := c.String("host") | ||
port := c.String("port") | ||
|
||
fmt.Printf("Connecting to server %s:%s\n", host, port) | ||
|
||
return nil | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/andylibrian/terjang | ||
|
||
go 1.15 | ||
|
||
require github.com/urfave/cli/v2 v2.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= | ||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= | ||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= | ||
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= | ||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= | ||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |