package handler

import (
	"helmet/app/logger"

	"helmet/app/operator"
	"helmet/pkg/mlbctl"

	"google.golang.org/grpc"
)

type HandlerConfig struct {
	Operator *operator.Operator
}

type Handler struct {
	mlbctl.UnimplementedControlServer
	oper *operator.Operator
	log  *logger.Logger
}

func NewHandler(conf *HandlerConfig) *Handler {
	hand := Handler{
		oper: conf.Operator,
	}
	hand.log = logger.NewLogger("handler")
	return &hand
}

func (hand *Handler) Register(gsrv *grpc.Server) {
	mlbctl.RegisterControlServer(gsrv, hand)
}
