| 12345678910111213141516171819202122232425262728293031323334 |
- // package service -- главный тип сервиса
- package service
- import (
- "gitp78su.ipnodns.ru/svi/goarch/lev2/mod_http"
- "gitp78su.ipnodns.ru/svi/kern/v3"
- "gitp78su.ipnodns.ru/svi/kern/v3/krn/ktypes"
- . "gitp78su.ipnodns.ru/svi/kern/v3/krn/ktypes"
- )
- // Service -- тип сервиса
- type Service struct {
- kCtx IKernelCtx
- modHttp *mod_http.ModHttp
- }
- // NewService -- возвращает новый сервис
- func NewService() *Service {
- kCtx := kern.GetKernelCtx()
- kCtx.Set("monolitName", "SviArch", "NewService()")
- sf := &Service{
- kCtx: kern.GetKernelCtx(),
- modHttp: mod_http.NewModHttp(),
- }
- return sf
- }
- // Run -- запуск сервиса
- func (sf *Service) Run() ktypes.Result[bool] {
- sHttp := sf.kCtx.Get("kServHttp").Val().(ktypes.IKernelServerHttp)
- go sHttp.Run()
- sf.kCtx.Wg().Wait()
- return ktypes.NewOk(true)
- }
|