delete

package
v0.78.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete ALL resources in DigitalOcean account",
	Long: `Delete ALL resources in DigitalOcean account

	Currently, all resources means:

	- Droplets
	- SSH Keys
	- Domains (with records)
	`,
	Args: cobra.NoArgs,
	Run: func(c *cobra.Command, args []string) {
		token := digitalocean_utils.GetToken()

		droplets := digitalocean_utils.PrepareAllDropletsDelete(token)
		sshKeys := digitalocean_utils.PrepareAllSSHKeysDelete(token)
		domains := digitalocean_utils.PrepareAllDomainsDelete(token)

		fmt.Println("")
		fmt.Println("Wait 10s, cancel clean up using ctrl-c")

		for i := 1; i <= 10; i++ {
			fmt.Print(".")
			time.Sleep(time.Second)
		}

		fmt.Println("")
		fmt.Println("")
		fmt.Println("Delete ...")
		fmt.Println("")

		digitalocean_utils.DoAllDropletsDelete(token, droplets)
		digitalocean_utils.DoAllSSHKeysDelete(token, sshKeys)
		digitalocean_utils.DoAllDomainsDelete(token, domains)

		fmt.Println("Done.")
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL