mirror of
https://github.com/simon987/ws_bucket.git
synced 2025-04-20 02:36:46 +00:00
Remove dead code
This commit is contained in:
parent
c068352e75
commit
532a7fe726
14
api/api.go
14
api/api.go
@ -24,11 +24,6 @@ var info = Info{
|
|||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
}
|
}
|
||||||
|
|
||||||
var motd = WebsocketMotd{
|
|
||||||
Info: info,
|
|
||||||
Motd: "Hello, world",
|
|
||||||
}
|
|
||||||
|
|
||||||
type WebApi struct {
|
type WebApi struct {
|
||||||
server fasthttp.Server
|
server fasthttp.Server
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
@ -90,18 +85,9 @@ func New(db *gorm.DB) *WebApi {
|
|||||||
api.db = db
|
api.db = db
|
||||||
db.AutoMigrate(&UploadSlot{})
|
db.AutoMigrate(&UploadSlot{})
|
||||||
|
|
||||||
api.setupMotd()
|
|
||||||
|
|
||||||
return api
|
return api
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *WebApi) setupMotd() {
|
|
||||||
var data []byte
|
|
||||||
data, _ = json.Marshal(motd)
|
|
||||||
motdMsg, _ := websocket.NewPreparedMessage(websocket.TextMessage, data)
|
|
||||||
api.MotdMessage = motdMsg
|
|
||||||
}
|
|
||||||
|
|
||||||
func (api *WebApi) Run() {
|
func (api *WebApi) Run() {
|
||||||
address := GetServerAddress()
|
address := GetServerAddress()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user