dump

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cmd = &cobra.Command{
		Use:   "dump",
		Short: "perform a logical dump, transform data, and store it in storage",
		Run: func(cmd *cobra.Command, args []string) {
			if err := logger.SetLogLevel(Config.Log.Level, Config.Log.Format); err != nil {
				log.Fatal().Err(err).Msg("")
			}

			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")
			}
			st = st.SubStorage(strconv.FormatInt(time.Now().UnixMilli(), 10), true)

			if Config.Common.TempDirectory == "" {
				log.Fatal().Msg("common.tmp_dir cannot be empty")
			}

			dump := cmdInternals.NewDump(Config, st, utils.DefaultTransformerRegistry)

			if err := dump.Run(ctx); err != nil {
				log.Fatal().Err(err).Msg("cannot make a backup")
			}

		},
	}
	Config = pgDomains.NewConfig()
)

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