s
This commit is contained in:
+3
-16
@@ -20,28 +20,15 @@ import (
|
||||
"simplegit/state"
|
||||
)
|
||||
|
||||
// Config carries the daemon's startup params. The server needs the git root to
|
||||
// open repos and the rest to answer the Status RPC (which also hands gitctl the
|
||||
// db_uri so it can connect directly for inspection reads).
|
||||
type Config struct {
|
||||
Root string
|
||||
RPCAddr string
|
||||
SSHAddr string
|
||||
ManageAddr string
|
||||
AuthURL string
|
||||
DBUri string
|
||||
SkipAuth bool
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
gitRepoRoot string
|
||||
cfg Config
|
||||
cfg *common.Config
|
||||
startedAt time.Time
|
||||
middleware *MiddlewareClient
|
||||
mut state.IStateMut
|
||||
}
|
||||
|
||||
func NewServer(cfg Config, middleware *MiddlewareClient, mut state.IStateMut) *Server {
|
||||
func NewServer(cfg *common.Config, middleware *MiddlewareClient, mut state.IStateMut) *Server {
|
||||
return &Server{
|
||||
gitRepoRoot: cfg.Root,
|
||||
cfg: cfg,
|
||||
@@ -511,7 +498,7 @@ func (s *Server) ACLDelete(ctx context.Context, req *connect.Request[v1.ACLDelet
|
||||
|
||||
func (s *Server) Status(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[v1.StatusResponse], error) {
|
||||
return connect.NewResponse(&v1.StatusResponse{
|
||||
RepoRoot: s.gitRepoRoot,
|
||||
Root: s.cfg.Root,
|
||||
RpcAddr: s.cfg.RPCAddr,
|
||||
SshAddr: s.cfg.SSHAddr,
|
||||
ManageAddr: s.cfg.ManageAddr,
|
||||
|
||||
Reference in New Issue
Block a user