From 32029d963e3b9d8f10762d5368a598b0476075f0 Mon Sep 17 00:00:00 2001 From: Howl Date: Tue, 19 Apr 2016 16:07:27 +0200 Subject: [PATCH] We git.zxq.co now --- .gitignore | 1 + app/method.go | 2 +- app/start.go | 6 +++--- app/tokens.go | 2 +- app/v1/404.go | 2 +- app/v1/badge.go | 2 +- app/v1/errors.go | 2 +- app/v1/friend.go | 2 +- app/v1/manage_user.go | 2 +- app/v1/meta.go | 9 ++++++--- app/v1/ping.go | 2 +- app/v1/privileges.go | 2 +- app/v1/token.go | 2 +- app/v1/user.go | 2 +- main.go | 7 +++---- 15 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 874eeb4..171f88d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +rippleapi api api.conf \ No newline at end of file diff --git a/app/method.go b/app/method.go index e1475c2..c8b48ca 100644 --- a/app/method.go +++ b/app/method.go @@ -5,8 +5,8 @@ import ( "encoding/json" "io/ioutil" + "git.zxq.co/ripple/rippleapi/common" "github.com/gin-gonic/gin" - "github.com/osuripple/api/common" ) // Method wraps an API method to a HandlerFunc. diff --git a/app/start.go b/app/start.go index 380861f..2ed336f 100644 --- a/app/start.go +++ b/app/start.go @@ -3,11 +3,11 @@ package app import ( "database/sql" + "git.zxq.co/ripple/rippleapi/app/internals" + "git.zxq.co/ripple/rippleapi/app/v1" + "git.zxq.co/ripple/rippleapi/common" "github.com/gin-gonic/contrib/gzip" "github.com/gin-gonic/gin" - "github.com/osuripple/api/app/internals" - "github.com/osuripple/api/app/v1" - "github.com/osuripple/api/common" ) // Start begins taking HTTP connections. diff --git a/app/tokens.go b/app/tokens.go index de4fb2c..e646818 100644 --- a/app/tokens.go +++ b/app/tokens.go @@ -5,7 +5,7 @@ import ( "database/sql" "fmt" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) // GetTokenFull retrieves an user ID and their token privileges knowing their API token. diff --git a/app/v1/404.go b/app/v1/404.go index b8408df..f9547ff 100644 --- a/app/v1/404.go +++ b/app/v1/404.go @@ -1,8 +1,8 @@ package v1 import ( + "git.zxq.co/ripple/rippleapi/common" "github.com/gin-gonic/gin" - "github.com/osuripple/api/common" ) type response404 struct { diff --git a/app/v1/badge.go b/app/v1/badge.go index 5510bde..1849b6d 100644 --- a/app/v1/badge.go +++ b/app/v1/badge.go @@ -3,7 +3,7 @@ package v1 import ( "database/sql" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) type singleBadge struct { diff --git a/app/v1/errors.go b/app/v1/errors.go index 7cf4fb2..2021a13 100644 --- a/app/v1/errors.go +++ b/app/v1/errors.go @@ -3,7 +3,7 @@ package v1 import ( "strings" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) // Boilerplate errors diff --git a/app/v1/friend.go b/app/v1/friend.go index c4dc2b4..173195f 100644 --- a/app/v1/friend.go +++ b/app/v1/friend.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) type friendData struct { diff --git a/app/v1/manage_user.go b/app/v1/manage_user.go index 37f9eae..89c5846 100644 --- a/app/v1/manage_user.go +++ b/app/v1/manage_user.go @@ -1,6 +1,6 @@ package v1 -import "github.com/osuripple/api/common" +import "git.zxq.co/ripple/rippleapi/common" type setAllowedData struct { UserID int `json:"user_id"` diff --git a/app/v1/meta.go b/app/v1/meta.go index bde04f5..a507f4d 100644 --- a/app/v1/meta.go +++ b/app/v1/meta.go @@ -10,7 +10,7 @@ import ( "syscall" "time" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) // MetaRestartGET restarts the API with Zero Downtime™. @@ -69,13 +69,16 @@ func MetaUpdateGET(md common.MethodData) common.CodeMessager { return common.SimpleResponse(500, "instance is not using git") } go func() { + if !execCommand("git", "pull", "origin", "master") { + return + } // go get - // -u: update all dependencies (including API source) + // -u: update all dependencies // -d: stop after downloading deps if !execCommand("go", "get", "-u", "-d") { return } - if !execCommand("go", "build") { + if !execCommand("go", "build", "-o", "-v", "api") { return } diff --git a/app/v1/ping.go b/app/v1/ping.go index f4eaf33..548be75 100644 --- a/app/v1/ping.go +++ b/app/v1/ping.go @@ -4,7 +4,7 @@ import ( "math/rand" "time" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) var rn = rand.New(rand.NewSource(time.Now().UnixNano())) diff --git a/app/v1/privileges.go b/app/v1/privileges.go index f2072d9..028ea0a 100644 --- a/app/v1/privileges.go +++ b/app/v1/privileges.go @@ -1,7 +1,7 @@ package v1 import ( - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" ) type privilegesData struct { diff --git a/app/v1/token.go b/app/v1/token.go index 78a6212..e7f0468 100644 --- a/app/v1/token.go +++ b/app/v1/token.go @@ -5,7 +5,7 @@ import ( "database/sql" "fmt" - "github.com/osuripple/api/common" + "git.zxq.co/ripple/rippleapi/common" "golang.org/x/crypto/bcrypt" ) diff --git a/app/v1/user.go b/app/v1/user.go index 2cb4926..5331cc4 100644 --- a/app/v1/user.go +++ b/app/v1/user.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "git.zxq.co/ripple/rippleapi/common" "github.com/gin-gonic/gin" - "github.com/osuripple/api/common" ) type userData struct { diff --git a/main.go b/main.go index 4a0e375..67245b0 100644 --- a/main.go +++ b/main.go @@ -9,12 +9,11 @@ import ( "syscall" "time" + "git.zxq.co/ripple/rippleapi/app" + "git.zxq.co/ripple/rippleapi/common" + "github.com/rcrowley/goagain" // Golint pls dont break balls _ "github.com/go-sql-driver/mysql" - "github.com/osuripple/api/app" - "github.com/osuripple/api/common" - - "github.com/rcrowley/goagain" ) func init() {