docindexer

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagA        = "a" // bookmark file <A>
	AttrHref    = "href"
	AttrAddDate = "add_date"
	AttrIcon    = "icon"
)
View Source
const (
	PropTempPath    = "docindexer.temp-path"
	DefaultTempPath = "/tmp/docindexer"
)
View Source
const (
	ResourceManageBookmark = "manage-bookmarks"

	MsgUnknownErr  = "Unknown error, please try again"
	MsgUploadFiled = "Upload failed, please try again"
)

Variables

View Source
var (
	ErrUnknown     = miso.NewErrf("Unknown error, please try again")
	ErrUploadFiled = miso.NewErrf("Upload failed, please try again")
)

Functions

func BookmarkMd5

func BookmarkMd5(bm Bookmark) string

func ListBookmarks

func ListBookmarks(rail miso.Rail, tx *gorm.DB, req ListBookmarksReq, userNo string) (any, error)

func ListBookmarksEp

func ListBookmarksEp(inb *miso.Inbound, req ListBookmarksReq) (any, error)

List bookmarks endpoint.

func MakeTempDirs

func MakeTempDirs(rail miso.Rail) error

func ProcessUploadedBookmarkFile

func ProcessUploadedBookmarkFile(rail miso.Rail, path string, user common.User) error

func RegisterRoutes

func RegisterRoutes(rail miso.Rail) error

func RemoveBookmark

func RemoveBookmark(rail miso.Rail, tx *gorm.DB, id int64, userNo string) error

func RemoveBookmarkEp

func RemoveBookmarkEp(inb *miso.Inbound, req RemoveBookmarkReq) (any, error)

Remove bookmark endpoint.

func SaveBookmarks

func SaveBookmarks(rail miso.Rail, tx *gorm.DB, bookmarkFile NetscapeBookmarkFile, user common.User) error

func ServerRun

func ServerRun(args []string) error

func TempFilePath

func TempFilePath(tempTkn string) string

func TransferTmpFile

func TransferTmpFile(rail miso.Rail, reader io.Reader) (string, error)

func UploadBookmarkFileEp

func UploadBookmarkFileEp(inb *miso.Inbound) (any, error)

Upload bookmark file endpoint.

Types

type Bookmark

type Bookmark struct {
	Name    string
	Href    string
	Icon    string
	AddDate string
}

func (Bookmark) String

func (b Bookmark) String() string

type ListBookmarksReq

type ListBookmarksReq struct {
	Name   *string
	Paging miso.Paging
}

type ListedBookmark

type ListedBookmark struct {
	Id     int64
	UserNo string
	Name   string
	Href   string
	Icon   string
}

type NetscapeBookmarkFile

type NetscapeBookmarkFile struct {
	Bookmarks []Bookmark
}

func ParseNetscapeBookmark

func ParseNetscapeBookmark(rail miso.Rail, body io.Reader) (NetscapeBookmarkFile, error)

func (*NetscapeBookmarkFile) Add

func (n *NetscapeBookmarkFile) Add(b Bookmark)

type NewBookmark

type NewBookmark struct {
	UserNo string
	Icon   string
	Name   string
	Href   string
	Md5    string
}

type RemoveBookmarkReq

type RemoveBookmarkReq struct {
	Id int64
}

Jump to

Keyboard shortcuts

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