trans

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Export action.GTSAction = func(ctx context.Context) error {
	dbConn, err := bundb.NewBunDBService(ctx)
	if err != nil {
		return fmt.Errorf("error creating dbservice: %s", err)
	}

	exporter := trans.NewExporter(dbConn)

	path := viper.GetString(config.Keys.AdminTransPath)
	if path == "" {
		return errors.New("no path set")
	}

	if err := exporter.ExportMinimal(ctx, path); err != nil {
		return err
	}

	return dbConn.Stop(ctx)
}

Export exports info from the database into a file

View Source
var Import action.GTSAction = func(ctx context.Context) error {
	dbConn, err := bundb.NewBunDBService(ctx)
	if err != nil {
		return fmt.Errorf("error creating dbservice: %s", err)
	}

	importer := trans.NewImporter(dbConn)

	path := viper.GetString(config.Keys.AdminTransPath)
	if path == "" {
		return errors.New("no path set")
	}

	if err := importer.Import(ctx, path); err != nil {
		return err
	}

	return dbConn.Stop(ctx)
}

Import imports info from a file into the database

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