@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
const (
|
||||
// Version is gorush server version.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"github.com/appleboy/gofight"
|
||||
@@ -19,8 +19,8 @@ func initTest() {
|
||||
PushConf.Core.Mode = "test"
|
||||
}
|
||||
|
||||
func TestPrintGoPushVersion(t *testing.T) {
|
||||
PrintGoPushVersion()
|
||||
func TestPrintGoRushVersion(t *testing.T) {
|
||||
PrintGoRushVersion()
|
||||
}
|
||||
|
||||
func TestRunNormalServer(t *testing.T) {
|
||||
@@ -85,7 +85,7 @@ func TestAPIStatusHandler(t *testing.T) {
|
||||
Run(routerEngine(), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
|
||||
data := []byte(r.Body.String())
|
||||
|
||||
value, _ := jsonparser.GetString(data, "goVersion")
|
||||
value, _ := jsonparser.GetString(data, "go_version")
|
||||
|
||||
assert.Equal(t, goVersion, value)
|
||||
assert.Equal(t, http.StatusOK, r.Code)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package gopush
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// PrintGoPushVersion provide print server engine
|
||||
func PrintGoPushVersion() {
|
||||
fmt.Printf(`GoPush %s, Compiler: %s %s, Copyright (C) 2016 Bo-Yi Wu, Inc.`,
|
||||
// PrintGoRushVersion provide print server engine
|
||||
func PrintGoRushVersion() {
|
||||
fmt.Printf(`GoRush %s, Compiler: %s %s, Copyright (C) 2016 Bo-Yi Wu, Inc.`,
|
||||
Version,
|
||||
runtime.Compiler,
|
||||
runtime.Version())
|
||||
@@ -18,7 +18,7 @@ func PrintGoPushVersion() {
|
||||
func VersionMiddleware() gin.HandlerFunc {
|
||||
// Set out header value for each response
|
||||
return func(c *gin.Context) {
|
||||
c.Writer.Header().Set("Server-Version", "GoPush/"+Version)
|
||||
c.Writer.Header().Set("Server-Version", "GoRush/"+Version)
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user