Files
stack/components/fctl/pkg/controller.go
RAGOT DavidandGitHub 0df34a4d94 feat: fctl output=<json> (#363)
+ Add controller interface
+ Add renderable interface

- A controller define his store. And Running cycle returning a renderable interface
- Json is handle between Run & Render is the proper flag is set
2023-07-07 09:36:12 +02:00

17 lines
303 B
Go

package fctl
import (
"github.com/spf13/cobra"
)
type Renderable interface {
Render(cmd *cobra.Command, args []string) error
}
type Controller[T any] interface {
GetStore() T
Run(cmd *cobra.Command, args []string) (Renderable, error)
}
type ExportedData struct {
Data interface{} `json:"data"`
}