diff --git a/consul.go b/consul.go new file mode 100644 index 0000000..6c2c3d0 --- /dev/null +++ b/consul.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "log" + "strconv" + "strings" + "time" + + "github.com/hashicorp/consul/api" +) + +type Consul struct { + RedisTTL time.Duration + Timeout time.Duration + MaxError int + Influxdb string + Month string + Retention float64 + MongoURI string + Database string + RedisURI string +} + +func getClient() { + client, err := api.NewClient(api.DefaultConfig()) + if err != nil { + panic(err) + } +} diff --git a/main.go b/main.go index 2eec5e4..3221956 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( ) const ( - _Version = "v4.4.5" + _Version = "v5.0.0" _Producer = 0 _Consumer = 1 _Remover = 2 diff --git a/options.go b/options.go index b0c6319..32c33d3 100644 --- a/options.go +++ b/options.go @@ -27,6 +27,7 @@ type Options struct { Month string Queue int Retention float64 + Consul string } var ( @@ -40,11 +41,12 @@ func usage() { fmt.Println(`Usage: llmongo -m -d - -r + -r -t -l -T - -i + -i + -C -q -R -v @@ -69,6 +71,7 @@ func init() { flag.StringVar(&dbs.Database, "d", "", "Mongodb Database") flag.StringVar(&dbs.RedisURI, "r", "", "Redis") flag.StringVar(&opts.LogFile, "l", opts.LogFile, "Logs filename") + flag.StringVar(&opts.Consul, "C", opts.Consul, "consul client") flag.DurationVar(&opts.RedisTTL, "t", opts.RedisTTL, "Redis keys TTL") flag.BoolVar(&opts.Version, "v", false, "Version") flag.DurationVar(&opts.Timeout, "T", 0, "Running timeout")