database

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package database handles bookmarks database management operations.

Index

Constants

This section is empty.

Variables

View Source
var (

	// backupCmd backup management.
	BackupNewCmd = &cobra.Command{
		Use:     "new",
		Short:   "Create a new backup",
		Aliases: []string{"create", "add"},
		RunE: func(cmd *cobra.Command, args []string) error {
			cfg, err := config.FromContext(cmd.Context())
			if err != nil {
				return fmt.Errorf("failed to get config: %w", err)
			}

			r, err := db.New(cfg.DBPath)
			if err != nil {
				return fmt.Errorf("backup: %w", err)
			}
			defer r.Close()

			return backupNewFunc(app.New(cmd.Context(),
				app.WithConfig(cfg),
				app.WithDB(r),
				app.WithConsole(ui.NewDefaultConsole(cmd.Context(), func(err error) {
					r.Close()
					sys.ErrAndExit(err)
				})),
			))
		},
	}
)

backupCmd backup management.

Functions

func NewCmd

func NewCmd(cfg *config.Config) *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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