mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 06:25:35 +08:00
28 lines
423 B
Go
28 lines
423 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/renorris/openfsd/db"
|
|
)
|
|
|
|
type Server struct {
|
|
dbRepo *db.Repositories
|
|
jwtSecret []byte
|
|
}
|
|
|
|
func NewServer(dbRepo *db.Repositories, jwtSecret []byte) (server *Server, err error) {
|
|
server = &Server{
|
|
dbRepo: dbRepo,
|
|
jwtSecret: jwtSecret,
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
func (s *Server) Run(ctx context.Context, addr string) (err error) {
|
|
e := s.setupRoutes()
|
|
e.Run(addr)
|
|
|
|
return
|
|
}
|