Skip to content

Commit

Permalink
add support for specifying node extras from command-line
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoch committed Jul 28, 2015
1 parent 4daec98 commit 4e1cadc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/cbft/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func main() {
expvars.Set("indexes", bleveHttp.IndexStats())

router, err := MainStart(cfg, uuid, tagsArr,
flags.Container, flags.Weight,
flags.Container, flags.Weight, flags.Extra,
flags.BindHttp, flags.DataDir,
flags.StaticDir, flags.StaticETag,
flags.Server, flags.Register, mr)
Expand Down Expand Up @@ -188,7 +188,7 @@ func MainWelcome(flagAliases map[string][]string) {
}

func MainStart(cfg cbgt.Cfg, uuid string, tags []string, container string,
weight int, bindHttp, dataDir, staticDir, staticETag, server string,
weight int, extras, bindHttp, dataDir, staticDir, staticETag, server string,
register string, mr *cbgt.MsgRing) (
*mux.Router, error) {
if server == "" {
Expand Down Expand Up @@ -220,7 +220,7 @@ func MainStart(cfg cbgt.Cfg, uuid string, tags []string, container string,

mgr := cbgt.NewManager(cbgt.VERSION, cfg,
uuid, tags, container, weight,
"", bindHttp, dataDir, server, &MainHandlers{})
extras, bindHttp, dataDir, server, &MainHandlers{})
err := mgr.Start(register)
if err != nil {
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions cmd/cbft/main_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Flags struct {
Tags string
Version bool
Weight int
Extra string
}

var flags Flags
Expand Down Expand Up @@ -158,6 +159,9 @@ func initFlags(flags *Flags) map[string][]string {
[]string{"weight"}, "INTEGER", 1,
"optional weight of this node, where a more capable"+
"\nnode should have higher weight; default is 1.")
s(&flags.Extra,
[]string{"extra", "e"}, "extra info", "",
"extra info you want stored with this node")

flag.Usage = func() {
if !flags.Help {
Expand Down

0 comments on commit 4e1cadc

Please sign in to comment.