github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/wsapi/api.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package wsapi
     5  
     6  import (
     7  	"github.com/masterhung0112/hk_server/v5/app"
     8  )
     9  
    10  type API struct {
    11  	App    *app.App
    12  	Router *app.WebSocketRouter
    13  }
    14  
    15  func Init(s *app.Server) {
    16  	a := app.New(app.ServerConnector(s))
    17  	api := &API{
    18  		App:    a,
    19  		Router: s.WebSocketRouter,
    20  	}
    21  
    22  	api.InitUser()
    23  	api.InitSystem()
    24  	api.InitStatus()
    25  }