bookmarks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db *gorm.DB

	Command = &cli.Command{
		Name:    "bookmarks",
		Usage:   "将书签导出到文件中",
		Aliases: []string{"b"},
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "browser",
				Aliases:  []string{"b"},
				Required: true,
				Usage:    "支持浏览器 chrome、edge 或 firefox",
			},
			&cli.StringFlag{
				Name:        "type",
				Aliases:     []string{"t"},
				Value:       "json",
				DefaultText: "json",
				Usage:       "导出文件类型,支持:json、csv",
				Action: func(context *cli.Context, s string) error {

					flag := false
					for _, v := range items {
						if v == s {
							flag = true
						}
					}

					if flag == false {
						return fmt.Errorf("type [%s] not support", s)
					}

					return nil
				},
			},
		},
		Action: Action,
	}
)

Functions

func Action

func Action(c *cli.Context) error

Types

type Bookmark

type Bookmark struct {
	Name     string     `json:"name"`
	URL      string     `json:"url,omitempty"`
	Children []Bookmark `json:"children,omitempty"`
}

type BookmarkRoot

type BookmarkRoot struct {
	Roots struct {
		BookmarkBar Bookmark `json:"bookmark_bar"`
	} `json:"roots"`
}

type MozBookmarks

type MozBookmarks struct {
	Name string `gorm:"name" json:"name" csv:"description"`
	Url  string `gorm:"url" json:"url" csv:"url"`
}

Jump to

Keyboard shortcuts

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