Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Cmd = &cobra.Command{ Use: "restore [flags] dumpId|latest", Args: cobra.ExactArgs(1), Short: "restore dump with ID or the latest to the target database", Run: func(cmd *cobra.Command, args []string) { if err := logger.SetLogLevel(Config.Log.Level, Config.Log.Format); err != nil { log.Fatal().Err(err).Msg("fatal") } ctx, cancel := context.WithCancel(context.Background()) defer cancel() st, err := builder.GetStorage(ctx, &Config.Storage, &Config.Log) if err != nil { log.Fatal().Err(err).Msg("fatal") } dumpId, err := getDumpId(ctx, st, args[0]) if err != nil { log.Fatal().Err(err).Msg("") } st = st.SubStorage(dumpId, true) restore := cmdInternals.NewRestore( Config.Common.PgBinPath, st, &Config.Restore.PgRestoreOptions, Config.Restore.Scripts, Config.Common.TempDirectory, ) log.Info(). Str("dumpId", dumpId). Msgf("restoring dump") if err := restore.Run(ctx); err != nil { log.Fatal().Err(err).Msg("fatal") } }, } Config = pgDomains.NewConfig() )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.