Merge pull request #6428 from kobergj/RefactorOcisPKG

[tests-only][full-ci] Cleanup ocis runtime
This commit is contained in:
kobergj
2023-06-05 14:40:29 +02:00
committed by GitHub
74 changed files with 428 additions and 1990 deletions

View File

@@ -1,13 +1,10 @@
package command
import (
"context"
"os"
"github.com/owncloud/ocis/v2/ocis-pkg/clihelper"
"github.com/thejerf/suture/v4"
ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
"github.com/urfave/cli/v2"
)
@@ -35,25 +32,3 @@ func Execute(cfg *config.Config) error {
})
return app.Run(os.Args)
}
// SutureService allows for the graph command to be embedded and supervised by a suture supervisor tree.
type SutureService struct {
cfg *config.Config
}
// NewSutureService creates a new graph.SutureService
func NewSutureService(cfg *ociscfg.Config) suture.Service {
cfg.Graph.Commons = cfg.Commons
return SutureService{
cfg: cfg.Graph,
}
}
func (s SutureService) Serve(ctx context.Context) error {
s.cfg.Context = ctx
if err := Execute(s.cfg); err != nil {
return err
}
return nil
}