feature-21, ajoute de la gestion des subnets #24

Manually merged
nicolas.boufideline merged 44 commits from feature-21 into main 2026-04-26 14:16:57 +00:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 59e83da1d6 - Show all commits

f-21: code: add database in api

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
GnomeZworc 2026-04-17 23:25:35 +02:00
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -35,7 +35,7 @@ func main() {
apiAddr := fmt.Sprintf("%s:%d", cfg.Api.Address, cfg.Api.Port)
promAddr := fmt.Sprintf("%s:%d", cfg.Prometheus.Address, cfg.Prometheus.Port)
go agentapi.New(q).Start(apiAddr)
go agentapi.New(q, db).Start(apiAddr)
go promserver.Start(promAddr, registry)
select {}

View file

@ -5,14 +5,16 @@ import (
"net/http"
"git.g3e.fr/syonad/two/pkg/worker"
"github.com/dgraph-io/badger/v4"
)
type Server struct {
queue *worker.Queue
db *badger.DB
}
func New(queue *worker.Queue) *Server {
return &Server{queue: queue}
func New(queue *worker.Queue, db *badger.DB) *Server {
return &Server{queue: queue, db: db}
}
func (s *Server) Start(address string) {