Evan Chen 2021-12-16 19:11:46 +08:00
parent c81b014919
commit 905e1779a5
3 changed files with 21 additions and 1 deletions

View File

@ -50,6 +50,9 @@ func Stop() {
} }
func Send(h *History) { func Send(h *History) {
if h.Type == "" {
h.Type = INFO
}
Tunnel <- h Tunnel <- h
} }

17
history/service.go Normal file
View File

@ -0,0 +1,17 @@
package history
import "kumoly.io/kumoly/app/system"
type Service struct {
system.BaseService
}
func (srv Service) GetName() string { return "history.Service" }
func (srv Service) IsService() bool { return true }
func (srv Service) Main() error {
Start(DBReceiver)
return nil
}
func (srv Service) Del() {
Stop()
}

View File

@ -9,7 +9,7 @@ import (
type BaseService struct{} type BaseService struct{}
func (srv BaseService) GetName() string { return "base" } func (srv BaseService) GetName() string { return "base" }
func (srv BaseService) GetDependencies() []string { return []string{""} } func (srv BaseService) GetDependencies() []string { return []string{} }
func (srv BaseService) IsService() bool { return false } func (srv BaseService) IsService() bool { return false }
func (srv BaseService) Init() error { return nil } func (srv BaseService) Init() error { return nil }
func (srv BaseService) Load() error { return nil } func (srv BaseService) Load() error { return nil }