package app

import (
	"fmt"
	"robot/config"
	"robot/ws"
)

// ModuleWebsocket Websocket客户端模块
type ModuleWebsocket struct {
	manager *ws.Manager
}

func (p *ModuleWebsocket) init() error {
	cfg := config.Get().Client
	p.manager = ws.NewManager(
		fmt.Sprintf("%s:%d", cfg.Websocket.Address, cfg.Websocket.Port),
	)
	return nil
}

func (p *ModuleWebsocket) start() error {
	p.manager.Start()
	return nil
}

func (p *ModuleWebsocket) stop() error {
	return nil
}
