File: toxiproxy.go

package info (click to toggle)
toxiproxy 2.0.0%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 388 kB
  • sloc: sh: 91; makefile: 59
file content (25 lines) | stat: -rw-r--r-- 504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
	"flag"
	"math/rand"
	"time"

	"github.com/Shopify/toxiproxy"
)

var host string
var port string

func init() {
	flag.StringVar(&host, "host", "localhost", "Host for toxiproxy's API to listen on")
	flag.StringVar(&port, "port", "8474", "Port for toxiproxy's API to listen on")
	seed := flag.Int64("seed", time.Now().UTC().UnixNano(), "Seed for randomizing toxics with")
	flag.Parse()
	rand.Seed(*seed)
}

func main() {
	server := toxiproxy.NewServer()
	server.Listen(host, port)
}