update format.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
21a31fd161
commit
0fe1c4cec3
18
config.go
18
config.go
|
@ -1,9 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConfYaml struct {
|
type ConfYaml struct {
|
||||||
|
@ -19,20 +19,20 @@ type SectionCore struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectionApi struct {
|
type SectionApi struct {
|
||||||
PushUri string `yaml:"push_uri"`
|
PushUri string `yaml:"push_uri"`
|
||||||
StatGoUri string `yaml:"stat_go_uri"`
|
StatGoUri string `yaml:"stat_go_uri"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectionAndroid struct {
|
type SectionAndroid struct {
|
||||||
Enabled bool `yaml:"enabled"`
|
Enabled bool `yaml:"enabled"`
|
||||||
ApiKey string `yaml:"apikey"`
|
ApiKey string `yaml:"apikey"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectionIos struct {
|
type SectionIos struct {
|
||||||
Enabled bool `yaml:"enabled"`
|
Enabled bool `yaml:"enabled"`
|
||||||
PemCertPath string `yaml:"pem_cert_path"`
|
PemCertPath string `yaml:"pem_cert_path"`
|
||||||
PemKeyPath string `yaml:"pem_key_path"`
|
PemKeyPath string `yaml:"pem_key_path"`
|
||||||
Production bool `yaml:"production"`
|
Production bool `yaml:"production"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildDefaultPushConf() ConfYaml {
|
func BuildDefaultPushConf() ConfYaml {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
PushConf ConfYaml
|
PushConf ConfYaml
|
||||||
CertificatePemIos tls.Certificate
|
CertificatePemIos tls.Certificate
|
||||||
ApnsClient *apns.Client
|
ApnsClient *apns.Client
|
||||||
)
|
)
|
||||||
|
|
5
main.go
5
main.go
|
@ -4,10 +4,10 @@ import (
|
||||||
api "github.com/appleboy/gin-status-api"
|
api "github.com/appleboy/gin-status-api"
|
||||||
"github.com/fvbock/endless"
|
"github.com/fvbock/endless"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
apns "github.com/sideshow/apns2"
|
apns "github.com/sideshow/apns2"
|
||||||
"github.com/sideshow/apns2/certificate"
|
"github.com/sideshow/apns2/certificate"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func AbortWithError(c *gin.Context, code int, message string) {
|
func AbortWithError(c *gin.Context, code int, message string) {
|
||||||
|
@ -87,6 +87,5 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
endless.ListenAndServe(":"+PushConf.Core.Port, GetMainEngine())
|
endless.ListenAndServe(":"+PushConf.Core.Port, GetMainEngine())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue