mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
refactor: Restructure project files for better organization, readability, and maintainability
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jkaninda/mysql-bkup/pkg"
|
"github.com/jkaninda/mysql-bkup/internal"
|
||||||
"github.com/jkaninda/mysql-bkup/utils"
|
"github.com/jkaninda/mysql-bkup/utils"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -18,7 +18,7 @@ var BackupCmd = &cobra.Command{
|
|||||||
Example: utils.BackupExample,
|
Example: utils.BackupExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
pkg.StartBackup(cmd)
|
internal.StartBackup(cmd)
|
||||||
} else {
|
} else {
|
||||||
utils.Fatal(`"backup" accepts no argument %q`, args)
|
utils.Fatal(`"backup" accepts no argument %q`, args)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jkaninda/mysql-bkup/pkg"
|
"github.com/jkaninda/mysql-bkup/internal"
|
||||||
"github.com/jkaninda/mysql-bkup/utils"
|
"github.com/jkaninda/mysql-bkup/utils"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -17,7 +17,7 @@ var MigrateCmd = &cobra.Command{
|
|||||||
Short: "Migrate database from a source database to a target database",
|
Short: "Migrate database from a source database to a target database",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
pkg.StartMigration(cmd)
|
internal.StartMigration(cmd)
|
||||||
} else {
|
} else {
|
||||||
utils.Fatal(`"migrate" accepts no argument %q`, args)
|
utils.Fatal(`"migrate" accepts no argument %q`, args)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jkaninda/mysql-bkup/pkg"
|
"github.com/jkaninda/mysql-bkup/internal"
|
||||||
"github.com/jkaninda/mysql-bkup/utils"
|
"github.com/jkaninda/mysql-bkup/utils"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -12,7 +12,7 @@ var RestoreCmd = &cobra.Command{
|
|||||||
Example: utils.RestoreExample,
|
Example: utils.RestoreExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
pkg.StartRestore(cmd)
|
internal.StartRestore(cmd)
|
||||||
} else {
|
} else {
|
||||||
utils.Fatal(`"restore" accepts no argument %q`, args)
|
utils.Fatal(`"restore" accepts no argument %q`, args)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jkaninda/encryptor"
|
"github.com/jkaninda/encryptor"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Package pkg /
|
// Package internal /
|
||||||
/*****
|
/*****
|
||||||
@author Jonas Kaninda
|
@author Jonas Kaninda
|
||||||
@license MIT License <https://opensource.org/licenses/MIT>
|
@license MIT License <https://opensource.org/licenses/MIT>
|
||||||
@Copyright © 2024 Jonas Kaninda
|
@Copyright © 2024 Jonas Kaninda
|
||||||
**/
|
**/
|
||||||
package pkg
|
package internal
|
||||||
|
|
||||||
const tmpPath = "/tmp/backup"
|
const tmpPath = "/tmp/backup"
|
||||||
const gpgHome = "/config/gnupg"
|
const gpgHome = "/config/gnupg"
|
||||||
Reference in New Issue
Block a user