app/history/service.go

36 lines
849 B
Go

package history
import (
"github.com/rs/zerolog/log"
"kumoly.io/kumoly/app/store"
)
type Service struct {
}
func (srv Service) GetName() string { return "history.Service" }
func (srv Service) IsService() bool { return true }
func (srv Service) GetDependencies() []string { return []string{"server.Service"} }
func (srv Service) Init() error {
l := log.With().Str("mod", "history").
Str("service", "history.Service").
Logger()
l.Debug().Msg("Migrating database for history.Service ...")
if err := store.Migrate(&History{}); err != nil {
l.Error().Err(err).Msg("Migrating database")
return err
}
return nil
}
func (srv Service) Main() error {
Start(DBReceiver)
return nil
}
func (srv Service) Del() {
Stop()
}
func (srv Service) Load() error { return nil }
func (srv Service) Health() error { return nil }