mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
+ 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
17 lines
303 B
Go
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"`
|
|
}
|