Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure directories and fix k3s upgrade version issue #241

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions cmd/apikey.go → cmd/apikey/apikey.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"errors"
Expand All @@ -9,7 +9,8 @@ import (
"github.com/spf13/cobra"
)

var apikeyCmd = &cobra.Command{
// APIKeyCmd is the root command for `civo apikey`
var APIKeyCmd = &cobra.Command{
Use: "apikey",
Aliases: []string{"apikeys"},
Short: "Manage API keys used to access your Civo account",
Expand Down Expand Up @@ -41,12 +42,12 @@ func apiKeyFind(search string) (string, error) {
}

func init() {
rootCmd.AddCommand(apikeyCmd)
apikeyCmd.AddCommand(apikeyListCmd)
apikeyCmd.AddCommand(apikeySaveCmd)
apikeyCmd.AddCommand(apikeyRemoveCmd)
apikeyCmd.AddCommand(apikeyCurrentCmd)
apikeyCmd.AddCommand(apikeyShowCmd)

APIKeyCmd.AddCommand(apikeyListCmd)
APIKeyCmd.AddCommand(apikeySaveCmd)
APIKeyCmd.AddCommand(apikeyRemoveCmd)
APIKeyCmd.AddCommand(apikeyCurrentCmd)
APIKeyCmd.AddCommand(apikeyShowCmd)

// Flags for "civo apikey save" command
apikeySaveCmd.Flags().BoolVar(&loadAPIKeyFromEnv, "load-from-env", false, "When set, the name and key will be taken from environment variables (see notes above)")
Expand Down
2 changes: 1 addition & 1 deletion cmd/apikey_current.go → cmd/apikey/apikey_current.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/apikey_list.go → cmd/apikey/apikey_list.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"sort"
Expand Down
2 changes: 1 addition & 1 deletion cmd/apikey_remove.go → cmd/apikey/apikey_remove.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/apikey_save.go → cmd/apikey/apikey_save.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion cmd/apikey_show.go → cmd/apikey/apikey_show.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package apikey

import (
"sort"
Expand Down
28 changes: 0 additions & 28 deletions cmd/completion.go

This file was deleted.

21 changes: 0 additions & 21 deletions cmd/completion_bash.go

This file was deleted.

21 changes: 0 additions & 21 deletions cmd/completion_fish.go

This file was deleted.

21 changes: 0 additions & 21 deletions cmd/completion_powershell.go

This file was deleted.

20 changes: 0 additions & 20 deletions cmd/completion_zsh.go

This file was deleted.

8 changes: 4 additions & 4 deletions cmd/disk_image.go → cmd/diskimage/disk_image.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package cmd
package diskimage

import (
"errors"

"github.com/spf13/cobra"
)

var diskImageCmd = &cobra.Command{
// DiskImageCmd manages disk images
var DiskImageCmd = &cobra.Command{
Use: "diskimage",
Aliases: []string{"diskimages", "template", "templates"},
Short: "Details of Civo disk images",
Expand All @@ -20,6 +21,5 @@ var diskImageCmd = &cobra.Command{
}

func init() {
rootCmd.AddCommand(diskImageCmd)
diskImageCmd.AddCommand(diskImageListCmd)
DiskImageCmd.AddCommand(diskImageListCmd)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package diskimage

import (
"os"
Expand Down
15 changes: 8 additions & 7 deletions cmd/domain.go → cmd/domain/domain.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package cmd
package domain

import (
"errors"

"github.com/spf13/cobra"
)

var domainCmd = &cobra.Command{
// DomainCmd manages domains
var DomainCmd = &cobra.Command{
Use: "domain",
Aliases: []string{"domains"},
Short: "Details of Civo domains",
Expand All @@ -33,13 +34,13 @@ var domainRecordCmd = &cobra.Command{
}

func init() {
rootCmd.AddCommand(domainCmd)
domainCmd.AddCommand(domainListCmd)
domainCmd.AddCommand(domainCreateCmd)
domainCmd.AddCommand(domainRemoveCmd)

DomainCmd.AddCommand(domainListCmd)
DomainCmd.AddCommand(domainCreateCmd)
DomainCmd.AddCommand(domainRemoveCmd)

// Domains record cmd
domainCmd.AddCommand(domainRecordCmd)
DomainCmd.AddCommand(domainRecordCmd)
domainRecordCmd.AddCommand(domainRecordListCmd)
domainRecordCmd.AddCommand(domainRecordCreateCmd)
domainRecordCmd.AddCommand(domainRecordShowCmd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/domain_create.go → cmd/domain/domain_create.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/domain_list.go → cmd/domain/domain_list.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"github.com/civo/cli/common"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"os"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"github.com/civo/civogo"
Expand Down
2 changes: 1 addition & 1 deletion cmd/domain_remove.go → cmd/domain/domain_remove.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package domain

import (
"errors"
Expand Down
16 changes: 8 additions & 8 deletions cmd/firewall.go → cmd/firewall/firewall.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package cmd
package firewall

import (
"errors"

"github.com/spf13/cobra"
)

var firewallCmd = &cobra.Command{
// FirewallCmd manages Civo firewalls
var FirewallCmd = &cobra.Command{
Use: "firewall",
Aliases: []string{"firewalls", "fw"},
Short: "Details of Civo firewalls",
Expand All @@ -33,17 +34,16 @@ var firewallRuleCmd = &cobra.Command{
}

func init() {
rootCmd.AddCommand(firewallCmd)
firewallCmd.AddCommand(firewallListCmd)
firewallCmd.AddCommand(firewallCreateCmd)
firewallCmd.AddCommand(firewallUpdateCmd)
firewallCmd.AddCommand(firewallRemoveCmd)
FirewallCmd.AddCommand(firewallListCmd)
FirewallCmd.AddCommand(firewallCreateCmd)
FirewallCmd.AddCommand(firewallUpdateCmd)
FirewallCmd.AddCommand(firewallRemoveCmd)

firewallCreateCmd.Flags().StringVarP(&firewallnetwork, "network", "n", "default", "the network to create the firewall")
firewallCreateCmd.Flags().BoolVarP(&createRules, "create-rules", "r", true, "the create rules flag is used to create the default firewall rules, if is not defined will be set to true")

// Firewalls rule cmd
firewallCmd.AddCommand(firewallRuleCmd)
FirewallCmd.AddCommand(firewallRuleCmd)
firewallRuleCmd.AddCommand(firewallRuleListCmd)
firewallRuleCmd.AddCommand(firewallRuleCreateCmd)
firewallRuleCmd.AddCommand(firewallRuleRemoveCmd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/firewall_create.go → cmd/firewall/firewall_create.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/firewall_list.go → cmd/firewall/firewall_list.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"github.com/civo/cli/common"
Expand Down
2 changes: 1 addition & 1 deletion cmd/firewall_remove.go → cmd/firewall/firewall_remove.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"os"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion cmd/firewall_update.go → cmd/firewall/firewall_update.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package firewall

import (
"fmt"
Expand Down
Loading