added REST API and simple unit test - and compose starter, still WIP for integ test

This commit is contained in:
josebarn
2017-08-15 21:14:14 -03:00
parent bd8a3f2ddd
commit 5e945440d0
58 changed files with 9040 additions and 25 deletions

33
main.go
View File

@@ -1,12 +1,33 @@
package main
import "fmt"
import (
. "drone-with-go/api"
"github.com/urfave/cli"
"log"
"os"
)
func main() {
fmt.Println(HelloWorld())
}
app := cli.NewApp()
// HelloWorld is a function that returns a string containing "hello world".
func HelloWorld() string {
return "hello world"
var redis_url string
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "redis, r",
Usage: "redis server uri",
Destination: &redis_url,
},
}
app.Action = func(c *cli.Context) error {
if len(redis_url) <= 0 {
log.Println("not using redis server")
}
ApiInit()
return nil
}
app.HideVersion = true
app.Run(os.Args)
}