We git.zxq.co now

This commit is contained in:
Howl 2016-04-19 16:07:27 +02:00
parent 7387ed4295
commit 32029d963e
15 changed files with 24 additions and 21 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
rippleapi
api api
api.conf api.conf

View File

@ -5,8 +5,8 @@ import (
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
"git.zxq.co/ripple/rippleapi/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/osuripple/api/common"
) )
// Method wraps an API method to a HandlerFunc. // Method wraps an API method to a HandlerFunc.

View File

@ -3,11 +3,11 @@ package app
import ( import (
"database/sql" "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/contrib/gzip"
"github.com/gin-gonic/gin" "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. // Start begins taking HTTP connections.

View File

@ -5,7 +5,7 @@ import (
"database/sql" "database/sql"
"fmt" "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. // GetTokenFull retrieves an user ID and their token privileges knowing their API token.

View File

@ -1,8 +1,8 @@
package v1 package v1
import ( import (
"git.zxq.co/ripple/rippleapi/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/osuripple/api/common"
) )
type response404 struct { type response404 struct {

View File

@ -3,7 +3,7 @@ package v1
import ( import (
"database/sql" "database/sql"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
type singleBadge struct { type singleBadge struct {

View File

@ -3,7 +3,7 @@ package v1
import ( import (
"strings" "strings"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
// Boilerplate errors // Boilerplate errors

View File

@ -5,7 +5,7 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
type friendData struct { type friendData struct {

View File

@ -1,6 +1,6 @@
package v1 package v1
import "github.com/osuripple/api/common" import "git.zxq.co/ripple/rippleapi/common"
type setAllowedData struct { type setAllowedData struct {
UserID int `json:"user_id"` UserID int `json:"user_id"`

View File

@ -10,7 +10,7 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
// MetaRestartGET restarts the API with Zero Downtime™. // 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") return common.SimpleResponse(500, "instance is not using git")
} }
go func() { go func() {
if !execCommand("git", "pull", "origin", "master") {
return
}
// go get // go get
// -u: update all dependencies (including API source) // -u: update all dependencies
// -d: stop after downloading deps // -d: stop after downloading deps
if !execCommand("go", "get", "-u", "-d") { if !execCommand("go", "get", "-u", "-d") {
return return
} }
if !execCommand("go", "build") { if !execCommand("go", "build", "-o", "-v", "api") {
return return
} }

View File

@ -4,7 +4,7 @@ import (
"math/rand" "math/rand"
"time" "time"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
var rn = rand.New(rand.NewSource(time.Now().UnixNano())) var rn = rand.New(rand.NewSource(time.Now().UnixNano()))

View File

@ -1,7 +1,7 @@
package v1 package v1
import ( import (
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
) )
type privilegesData struct { type privilegesData struct {

View File

@ -5,7 +5,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
"github.com/osuripple/api/common" "git.zxq.co/ripple/rippleapi/common"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )

View File

@ -8,8 +8,8 @@ import (
"strings" "strings"
"time" "time"
"git.zxq.co/ripple/rippleapi/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/osuripple/api/common"
) )
type userData struct { type userData struct {

View File

@ -9,12 +9,11 @@ import (
"syscall" "syscall"
"time" "time"
"git.zxq.co/ripple/rippleapi/app"
"git.zxq.co/ripple/rippleapi/common"
"github.com/rcrowley/goagain"
// Golint pls dont break balls // Golint pls dont break balls
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/osuripple/api/app"
"github.com/osuripple/api/common"
"github.com/rcrowley/goagain"
) )
func init() { func init() {