export

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package export implements common exporting functionnality

Index

Constants

View Source
const (
	// Netscape Bookmark file format
	NetscapeHTML = iota
	// Pocket HTML file format
	PocketHTML

	// Json pinboard/wallabag file format
	JSON

	// Generic RSS-XML format
	RSS
)

export formats

Variables

This section is empty.

Functions

This section is empty.

Types

type BookmarksExporter

type BookmarksExporter struct {

	// bookmark separator (ex: , for json fields)
	Separator string
	// contains filtered or unexported fields
}

func NewBookmarksExporter

func NewBookmarksExporter(
	e Exporter,
	w io.Writer,
) BookmarksExporter

func (BookmarksExporter) ExportBookmarks

func (be BookmarksExporter) ExportBookmarks(bookmarks []*gosuki.Bookmark) error

func (BookmarksExporter) ExportFromRows

func (be BookmarksExporter) ExportFromRows(rows *sqlx.Rows) error

type Exporter

type Exporter interface {
	ExportBookmarks(bookmarks []*gosuki.Bookmark, w io.Writer) error
	MarshalBookmark(*gosuki.Bookmark) []byte
	WriteHeader(w io.Writer) error
	WriteFooter(w io.Writer) error
}

type JSONExporter

type JSONExporter struct{}

func (*JSONExporter) ExportBookmarks

func (je *JSONExporter) ExportBookmarks(bookmarks []*gosuki.Bookmark, w io.Writer) error

func (*JSONExporter) MarshalBookmark

func (je *JSONExporter) MarshalBookmark(book *gosuki.Bookmark) []byte

func (*JSONExporter) WriteFooter

func (je *JSONExporter) WriteFooter(w io.Writer) error

func (*JSONExporter) WriteHeader

func (je *JSONExporter) WriteHeader(w io.Writer) error

type NetscapeHTMLExporter

type NetscapeHTMLExporter struct{}

func (*NetscapeHTMLExporter) ExportBookmarks

func (ns *NetscapeHTMLExporter) ExportBookmarks(bookmarks []*gosuki.Bookmark, w io.Writer) error

func (*NetscapeHTMLExporter) MarshalBookmark

func (ns *NetscapeHTMLExporter) MarshalBookmark(book *gosuki.Bookmark) []byte

func (*NetscapeHTMLExporter) WriteFooter

func (ns *NetscapeHTMLExporter) WriteFooter(w io.Writer) error

func (*NetscapeHTMLExporter) WriteHeader

func (ns *NetscapeHTMLExporter) WriteHeader(w io.Writer) error

type PocketHTMLExporter

type PocketHTMLExporter struct{}

func (*PocketHTMLExporter) ExportBookmarks

func (pe *PocketHTMLExporter) ExportBookmarks(bookmarks []*gosuki.Bookmark, w io.Writer) error

func (*PocketHTMLExporter) MarshalBookmark

func (pe *PocketHTMLExporter) MarshalBookmark(book *gosuki.Bookmark) []byte

func (*PocketHTMLExporter) WriteFooter

func (pe *PocketHTMLExporter) WriteFooter(w io.Writer) error

func (*PocketHTMLExporter) WriteHeader

func (pe *PocketHTMLExporter) WriteHeader(w io.Writer) error

type RSSXMLExporter

type RSSXMLExporter struct{}

func (*RSSXMLExporter) ExportBookmarks

func (rs *RSSXMLExporter) ExportBookmarks(bookmarks []*gosuki.Bookmark, w io.Writer) error

func (*RSSXMLExporter) MarshalBookmark

func (rs *RSSXMLExporter) MarshalBookmark(book *gosuki.Bookmark) []byte

func (*RSSXMLExporter) WriteFooter

func (rs *RSSXMLExporter) WriteFooter(w io.Writer) error

func (*RSSXMLExporter) WriteHeader

func (rs *RSSXMLExporter) WriteHeader(w io.Writer) error

Jump to

Keyboard shortcuts

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