exporting

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVisibilityInvalid error = errors.New("invalid value for visibility")
)

Functions

This section is empty.

Types

type FakeRepository

type FakeRepository struct {
	Bookmarks []bookmark.Bookmark
}

func (*FakeRepository) BookmarkGetAll

func (r *FakeRepository) BookmarkGetAll(userUUID string) ([]bookmark.Bookmark, error)

func (*FakeRepository) BookmarkGetAllPrivate

func (r *FakeRepository) BookmarkGetAllPrivate(userUUID string) ([]bookmark.Bookmark, error)

func (*FakeRepository) BookmarkGetAllPublic

func (r *FakeRepository) BookmarkGetAllPublic(userUUID string) ([]bookmark.Bookmark, error)

type Repository

type Repository interface {
	// BookmarkGetAll returns all bookmarks for a given user UUID.
	BookmarkGetAll(userUUID string) ([]bookmark.Bookmark, error)

	// BookmarkGetAllPrivate returns all private bookmarks for a given user UUID.
	BookmarkGetAllPrivate(userUUID string) ([]bookmark.Bookmark, error)

	// BookmarkGetAllPublic returns all public bookmarks for a given user UUID.
	BookmarkGetAllPublic(userUUID string) ([]bookmark.Bookmark, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles bookmark export operations.

func NewService

func NewService(r Repository) *Service

NewService initializes and returns a new Service.

func (*Service) ExportAsNetscapeDocument

func (s *Service) ExportAsNetscapeDocument(userUUID string, visibility Visibility) (*netscape.Document, error)

ExportAsNetscapeDocument exports a given user's bookmarks matching the provided Visibility as a Netscape bookmark document.

type Visibility

type Visibility string

Visibility represents a visibility filter for bookmarks.

const (
	// Public and private bookmarks.
	VisibilityAll Visibility = "all"

	// Private bookmarks only.
	VisibilityPrivate Visibility = "private"

	// Public bookmarks only.
	VisibilityPublic Visibility = "public"
)

Jump to

Keyboard shortcuts

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