stringer and cleanup

This commit is contained in:
Cadey Ratio 2017-08-18 09:06:34 -07:00
parent 35f0a86c2c
commit dc2d32b002
6 changed files with 27 additions and 4 deletions

View File

@ -72,6 +72,8 @@ func main() {
if err != nil { if err != nil {
log.Printf("tasks:http: error publishing results: %v", err) log.Printf("tasks:http: error publishing results: %v", err)
} }
log.Printf()
}) })
for { for {

View File

@ -2,20 +2,23 @@ version: "3"
services: services:
rqlite: rqlite:
restart: always
image: rqlite/rqlite:4.0.2 image: rqlite/rqlite:4.0.2
volumes: volumes:
- rqlite:/rqlite/file - rqlite:/rqlite/file
command: -on-disk -http-adv-addr rqlite:4001 command: -on-disk -http-adv-addr rqlite:4001
nats: nats:
restart: always
image: nats:1.0.2 image: nats:1.0.2
entrypoint: "/gnatsd -DV" # uncomment for debugging message queue issues #entrypoint: "/gnatsd -DV" # uncomment for debugging message queue issues
expose: expose:
- "4222" - "4222"
ports: ports:
- "8222:8222" - "8222:8222"
worker: worker:
restart: always
image: xena/mercy:$GIT_COMMIT image: xena/mercy:$GIT_COMMIT
environment: environment:
NATS_URL: nats://nats:4222 NATS_URL: nats://nats:4222
@ -24,6 +27,7 @@ services:
- nats - nats
kronos: kronos:
restart: always
image: xena/mercy:$GIT_COMMIT image: xena/mercy:$GIT_COMMIT
depends_on: depends_on:
- nats - nats
@ -34,6 +38,7 @@ services:
command: /go/bin/kronos command: /go/bin/kronos
mercyd: mercyd:
restart: always
image: xena/mercy:$GIT_COMMIT image: xena/mercy:$GIT_COMMIT
environment: environment:
NATS_URL: nats://nats:4222 NATS_URL: nats://nats:4222

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"time" "time"
"github.com/nats-io/go-nats" nats "github.com/nats-io/go-nats"
) )
func NatsConnect(u string) (*nats.Conn, error) { func NatsConnect(u string) (*nats.Conn, error) {

View File

@ -0,0 +1,16 @@
// Code generated by "stringer -type=Result"; DO NOT EDIT.
package common
import "fmt"
const _Result_name = "UnknownOKDegradedFailed"
var _Result_index = [...]uint8{0, 7, 9, 17, 23}
func (i Result) String() string {
if i < 0 || i >= Result(len(_Result_index)-1) {
return fmt.Sprintf("Result(%d)", i)
}
return _Result_name[_Result_index[i]:_Result_index[i+1]]
}

View File

@ -4,6 +4,8 @@ import "time"
type Result int type Result int
//go:generate stringer -type=Result
const ( const (
Unknown Result = iota Unknown Result = iota
OK OK

View File

@ -2,7 +2,6 @@ package database
import ( import (
"database/sql" "database/sql"
"log"
"time" "time"
"git.xeserv.us/xena/mercy/internal/common" "git.xeserv.us/xena/mercy/internal/common"
@ -123,7 +122,6 @@ func (c *Checks) InsertCheck(ch *common.Check) error {
func (c *Checks) GetAllChecks() ([]common.Check, error) { func (c *Checks) GetAllChecks() ([]common.Check, error) {
var result []common.Check var result []common.Check
q := c.getAllChecks.Bind() q := c.getAllChecks.Bind()
log.Println(q)
res, err := c.conn.QueryOne(q) res, err := c.conn.QueryOne(q)
if err != nil { if err != nil {
return nil, err return nil, err