f-21: code: add database in api
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
82fa401680
commit
59e83da1d6
2 changed files with 5 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue