Move packages to root folder
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 33s

Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
Jan Tytgat
2025-04-22 13:47:12 +02:00
parent 26059ea3e9
commit 4fab7c8554
17 changed files with 8 additions and 6 deletions

View File

@ -0,0 +1,38 @@
package application
import (
"context"
"fmt"
"github.com/spf13/cobra"
)
type Application interface {
Start(ctx context.Context) error
Shutdown() error
}
func New(c Config) (Application, error) {
var cmd *cobra.Command
var err error
if cmd, err = c.getRootCommand(); err != nil {
return nil, err
}
return &application{
cmd: cmd,
}, nil
}
type application struct {
cmd *cobra.Command
}
func (a *application) Start(ctx context.Context) error {
return a.cmd.ExecuteContext(ctx)
}
func (a *application) Shutdown() error {
fmt.Println("Shutdown")
return nil
}