-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kasper J. Hermansen <[email protected]>
- Loading branch information
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/lunarway/shuttle/internal/extensions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newExtCmd() *cobra.Command { | ||
extManager := extensions.NewExtensionsManager("some registry") | ||
|
||
cmd := &cobra.Command{ | ||
Use: "ext", | ||
Long: "helps you manage shuttle extensions", | ||
} | ||
|
||
cmd.AddCommand( | ||
newExtInstallCmd(extManager), | ||
newExtUpdateCmd(extManager), | ||
newExtInitCmd(extManager), | ||
) | ||
|
||
return cmd | ||
} | ||
|
||
func newExtInstallCmd(extManager *extensions.ExtensionsManager) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "install", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return nil | ||
}, | ||
} | ||
|
||
return cmd | ||
} | ||
|
||
func newExtUpdateCmd(extManager *extensions.ExtensionsManager) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "update", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return nil | ||
}, | ||
} | ||
|
||
return cmd | ||
} | ||
|
||
func newExtInitCmd(extManager *extensions.ExtensionsManager) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "init", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return nil | ||
}, | ||
} | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package extensions | ||
|
||
import "context" | ||
|
||
type ExtensionsManager struct { | ||
registry string | ||
} | ||
|
||
func NewExtensionsManager(registry string) *ExtensionsManager { | ||
return &ExtensionsManager{ | ||
registry: registry, | ||
} | ||
} | ||
|
||
func (e *ExtensionsManager) Init(ctx context.Context) error { | ||
return nil | ||
} | ||
|
||
func (e *ExtensionsManager) GetAll(ctx context.Context) ([]Extension, error) { | ||
return nil, nil | ||
} | ||
|
||
func (e *ExtensionsManager) Install(ctx context.Context) error { | ||
return nil | ||
} | ||
|
||
func (e *ExtensionsManager) Update(ctx context.Context) error { | ||
return nil | ||
} | ||
|
||
type Extension struct{} |