2026-02-21 16:57:42 +03:00
|
|
|
package processor
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"task-processor/internal/taskAgent"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const pkgLogHeader string = "Processor |"
|
|
|
|
|
|
|
|
|
|
type handler struct {
|
|
|
|
|
*service
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Addr struct {
|
|
|
|
|
Host string
|
2026-04-03 11:46:29 +03:00
|
|
|
Port uint16
|
2026-02-21 16:57:42 +03:00
|
|
|
User string
|
|
|
|
|
Pass string
|
|
|
|
|
Vhost string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Deps struct {
|
2026-04-08 12:15:24 +03:00
|
|
|
Ctx context.Context
|
|
|
|
|
TA taskAgent.TaskAgent
|
|
|
|
|
Addr Addr
|
|
|
|
|
ChanLen uint
|
|
|
|
|
LoggingEnabled bool
|
2026-02-21 16:57:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewHandler(deps Deps) Processor {
|
|
|
|
|
return &handler{
|
2026-04-03 11:46:29 +03:00
|
|
|
service: newService(deps),
|
2026-02-21 16:57:42 +03:00
|
|
|
}
|
|
|
|
|
}
|