mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 05:31:44 +08:00
25 lines
367 B
Go
25 lines
367 B
Go
package route
|
|
|
|
import (
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
"github.com/tnb-labs/panel/internal/service"
|
|
)
|
|
|
|
type Ws struct {
|
|
ws *service.WsService
|
|
}
|
|
|
|
func NewWs(ws *service.WsService) *Ws {
|
|
return &Ws{
|
|
ws: ws,
|
|
}
|
|
}
|
|
|
|
func (route *Ws) Register(r *chi.Mux) {
|
|
r.Route("/api/ws", func(r chi.Router) {
|
|
r.Get("/ssh", route.ws.Session)
|
|
r.Get("/exec", route.ws.Exec)
|
|
})
|
|
}
|