From cf50c7b0ff063bc6d08e8c0086700a2cfdd80b32 Mon Sep 17 00:00:00 2001 From: Daniel Huckstep Date: Fri, 30 Aug 2013 18:21:00 -0600 Subject: [PATCH] make it officially version 0.0.1 --- README.md | 5 ++++- balance.go | 5 ++++- version.go | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 version.go diff --git a/README.md b/README.md index 89c403e..e609a68 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ Simple TCP/HTTP/HTTPS load balancer in Go balance tcp -bind :4000 localhost:4001 localhost:4002 # HTTP mode - balance http -bind :4000 localhost:4001 localhost:4002 + balance http -bind :4000 localhost:4001 localhost:4002 + + # HTTPS mode + balance https -bind :4000 -cert ssl.crt -key ssl.key localhost:4001 localhost:4002 ## License diff --git a/balance.go b/balance.go index 4cb13df..f44c0b4 100644 --- a/balance.go +++ b/balance.go @@ -8,7 +8,10 @@ import ( "os" ) -var cmd = &commander.Commander{Name: "balance"} +var cmd = &commander.Commander{ + Name: "balance", + Short: "load balance tcp, http, and https connections to multiple backends", +} func ensureBind(bindFlag *flag.Flag) string { if bindFlag == nil { diff --git a/version.go b/version.go new file mode 100644 index 0000000..e7fad1e --- /dev/null +++ b/version.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/gonuts/commander" +) + +const Version = "0.0.1" + +func version(cmd *commander.Command, args []string) { + fmt.Println(Version) +} + +func init() { + fs := newFlagSet("tcp") + + cmd.Commands = append(cmd.Commands, &commander.Command{ + UsageLine: "version", + Short: "display version information", + Flag: *fs, + Run: version, + }) +}