Files
ocis/services/postprocessing/pkg/command/root.go
T
jkoberg e208a96430 Start PP service in single binary (configurable)
Start PP service in single binary (configurable)

Start PP service in single binary (configurable)

start pp service with single binary and make it configurable

Signed-off-by: jkoberg <jkoberg@owncloud.com>

implement delay step

Signed-off-by: jkoberg <jkoberg@owncloud.com>

deactivate functionality

Signed-off-by: jkoberg <jkoberg@owncloud.com>

configure tokensigning

Signed-off-by: jkoberg <jkoberg@owncloud.com>

deactivate async uploads

Signed-off-by: jkoberg <jkoberg@owncloud.com>

final touches

Signed-off-by: jkoberg <jkoberg@owncloud.com>

next bump of the reva

Signed-off-by: jkoberg <jkoberg@owncloud.com>
2022-07-20 13:27:46 +02:00

57 lines
1.3 KiB
Go

package command
import (
"context"
"os"
"github.com/owncloud/ocis/v2/ocis-pkg/clihelper"
ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/services/postprocessing/pkg/config"
"github.com/thejerf/suture/v4"
"github.com/urfave/cli/v2"
)
// GetCommands provides all commands for this service
func GetCommands(cfg *config.Config) cli.Commands {
return []*cli.Command{
// start this service
Server(cfg),
// interaction with this service
// infos about this service
Health(cfg),
Version(cfg),
}
}
// Execute is the entry point for the postprocessing command.
func Execute(cfg *config.Config) error {
app := clihelper.DefaultApp(&cli.App{
Name: "postprocessing",
Usage: "starts postprocessing service",
Commands: GetCommands(cfg),
})
return app.Run(os.Args)
}
// SutureService allows for the postprocessing command to be embedded and supervised by a suture supervisor tree.
type SutureService struct {
cfg *config.Config
}
// NewSutureService creates a new postprocessing.SutureService
func NewSutureService(cfg *ociscfg.Config) suture.Service {
cfg.Postprocessing.Commons = cfg.Commons
return SutureService{
cfg: cfg.Postprocessing,
}
}
// Serve to implement Server interface
func (s SutureService) Serve(ctx context.Context) error {
s.cfg.Context = ctx
return Execute(s.cfg)
}