change signature of interfaces to fit Interface interface

This commit is contained in:
Robin Olsen
2026-02-12 19:57:52 +01:00
parent 0b840f87d8
commit 08ded5384c
4 changed files with 35 additions and 9 deletions

View File

@@ -11,8 +11,14 @@ import (
// CLIConfig is an alias for service.Config, used to configure the CLI.
type CLIConfig = service.Config
type CLI struct{}
func NewCli() *CLI {
return &CLI{}
}
// Run initializes the services and executes the CLI commands.
func Run(ctx context.Context, config CLIConfig) error {
func (c *CLI) Run(ctx context.Context, config CLIConfig) error {
svc, cleanup, err := service.NewServices(ctx, config)
if err != nil {
return err
@@ -30,7 +36,7 @@ func Run(ctx context.Context, config CLIConfig) error {
}
// RunWithArgs initializes the services and executes the CLI commands with the provided arguments.
func RunWithArgs(ctx context.Context, config CLIConfig, args []string) error {
func (c *CLI) RunWithArgs(ctx context.Context, config CLIConfig, args []string) error {
svc, cleanup, err := service.NewServices(ctx, config)
if err != nil {
return err