We git.zxq.co now
This commit is contained in:
parent
7387ed4295
commit
32029d963e
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
|
rippleapi
|
||||||
api
|
api
|
||||||
api.conf
|
api.conf
|
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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"`
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()))
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
7
main.go
7
main.go
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user