This commit is contained in:
Jabberwocky238
2026-07-16 08:33:38 -04:00
parent 3ed6a7d804
commit 3de46894d0
6 changed files with 100 additions and 43 deletions
+3 -16
View File
@@ -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,