Browse Source

取消agent的event机制,改为对外提供API

gitlink
Sydonian 2 years ago
parent
commit
4f247bac03
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      internal/services/service.go
  2. +3
    -3
      main.go

+ 2
- 2
internal/services/service.go View File

@@ -7,10 +7,10 @@ import (

type Service struct {
db *mydb.DB
scanner *sccli.ScannerClient
scanner *sccli.Client
}

func NewService(db *mydb.DB, scanner *sccli.ScannerClient) *Service {
func NewService(db *mydb.DB, scanner *sccli.Client) *Service {
return &Service{
db: db,
scanner: scanner,


+ 3
- 3
main.go View File

@@ -31,12 +31,12 @@ func main() {
log.Fatalf("new db failed, err: %s", err.Error())
}

scanner, err := sccli.NewScannerClient(&config.Cfg().RabbitMQ)
scanner, err := sccli.NewClient(&config.Cfg().RabbitMQ)
if err != nil {
log.Fatalf("new scanner client failed, err: %s", err.Error())
}

coorSvr, err := rasvr.NewCoordinatorServer(services.NewService(db, scanner), &config.Cfg().RabbitMQ)
coorSvr, err := rasvr.NewServer(services.NewService(db, scanner), &config.Cfg().RabbitMQ)
if err != nil {
log.Fatalf("new coordinator server failed, err: %s", err.Error())
}
@@ -52,7 +52,7 @@ func main() {
<-forever
}

func serveCoorServer(server *rasvr.CoordinatorServer) {
func serveCoorServer(server *rasvr.Server) {
log.Info("start serving command server")

err := server.Serve()


Loading…
Cancel
Save