Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
githubtasks
.test
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: go

go:
- 1.9

branches:
only:
- master

before_install:
- ./look_for_logs.sh
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/lint/golint
- go get github.com/GeertJohan/fgt
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover;
fi

script:
- fgt golint $(find . | grep .go$ | grep -v githubtasks.pb.go)
- $HOME/gopath/bin/goveralls -service=travis-ci -ignore=githubtasks.go -package github.com/brotherlogic/githubtasks
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# recordadder
[![Coverage Status](https://coveralls.io/repos/github/brotherlogic/recordadder/badge.svg)](https://coveralls.io/github/brotherlogic/recordadder)
# githubtasks
[![Coverage Status](https://coveralls.io/repos/github/brotherlogic/githubtasks/badge.svg)](https://coveralls.io/github/brotherlogic/githubtasks)
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protoc --proto_path ../../../ -I=./proto --go_out=plugins=grpc:./proto proto/githubtasks.proto
71 changes: 71 additions & 0 deletions githubtasks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package main

import (
"flag"
"fmt"
"io/ioutil"
"log"

"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"

pbg "github.com/brotherlogic/goserver/proto"
)

//Server main server type
type Server struct {
*goserver.GoServer
}

// Init builds the server
func Init() *Server {
s := &Server{
GoServer: &goserver.GoServer{},
}
return s
}

// DoRegister does RPC registration
func (s *Server) DoRegister(server *grpc.Server) {
//Pass
}

// ReportHealth alerts if we're not healthy
func (s *Server) ReportHealth() bool {
return true
}

// Shutdown the server
func (s *Server) Shutdown(ctx context.Context) error {
return nil
}

// Mote promotes/demotes this server
func (s *Server) Mote(ctx context.Context, master bool) error {
return nil
}

// GetState gets the state of the server
func (s *Server) GetState() []*pbg.State {
return []*pbg.State{
&pbg.State{Key: "no", Value: int64(233)},
}
}

func main() {
var quiet = flag.Bool("quiet", false, "Show all output")
flag.Parse()

//Turn off logging
if *quiet {
log.SetFlags(0)
log.SetOutput(ioutil.Discard)
}
server := Init()
server.PrepServer()
server.Register = server
server.RegisterServerV2("githubtasks", false, false)

fmt.Printf("%v", server.Serve())
}
7 changes: 7 additions & 0 deletions githubtasks_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "testing"

func TestNothing(t *testing.T) {
dummy()
}
4 changes: 4 additions & 0 deletions githubtasksutils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package main

func dummy() {
}
20 changes: 20 additions & 0 deletions look_for_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
grep log.Print * -Rl | grep .go$ | grep -v _test.go
RESULT=$?
if [ $RESULT != 1 ]; then
exit 1
fi

grep context.Background * -Rl | grep .go$ | grep -v _test.go
RESULT=$?
if [ $RESULT != 1 ]; then
exit 1
fi

RESULT1=$(grep "conn, err" *.go -R | wc | awk '{print $1}')
RESULT2=$(grep "conn.Close" *.go -R | wc| awk '{print $1}')

if [ $RESULT1 != $RESULT2 ]; then
echo "Missing Closes!"
exit 1
fi