Skip to content

Commit

Permalink
basic setup: stream registration, api stub
Browse files Browse the repository at this point in the history
  • Loading branch information
gondor committed Sep 18, 2016
1 parent 933afdc commit 6d721f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 9 additions & 5 deletions beethoven.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/ContainX/beethoven/config"
"github.com/ContainX/beethoven/proxy"
"github.com/ContainX/depcon/pkg/logger"
"github.com/spf13/cobra"
)
Expand All @@ -21,25 +22,25 @@ Beethoven (Mesos/Marathon HTTP based Proxy)
)

var (
// Added via ldflags
/* LDFlags */
version = "-"
built = ""

// Root command is the parent to all other commands
/* CLI commands */

rootCmd = &cobra.Command{
Use: "beethoven [config-file | remote-server-url]",
Short: "Mesos/Marathon HTTP based Proxy",
Long: fmt.Sprintf(Usage, version, built),
Example: Example,
}

serveCmd = &cobra.Command{
Use: "serve",
Short: "Start serving traffic",
Run: serve,
Example: Example,
}

// Logger
log = logger.GetLogger("beethoven")
)

Expand All @@ -48,7 +49,10 @@ func serve(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatal(err.Error())
}
fmt.Println(config)
config.Version = version

proxy.New(config).Serve()

}

func main() {
Expand Down
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ type Config struct {

// Port to listen to HTTP requests. Default 7777
Port int `json:"port"`

// Location to nginx.conf template
Template string `json:"template"`

/* Internal */
Version string `json:"-"`
}

var (
Expand Down

0 comments on commit 6d721f9

Please sign in to comment.