shiori

package
v0.0.0-...-d323686 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID          = "shiori"
	EndpointKey = "endpoint"
	UsernameKey = "username"
	PasswordKey = "password"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BookmarkResponse

type BookmarkResponse struct {
	Id         int    `json:"id"`
	Url        string `json:"url"`
	Title      string `json:"title"`
	Excerpt    string `json:"excerpt"`
	Author     string `json:"author"`
	Public     int    `json:"public"`
	Modified   string `json:"modified"`
	Html       string `json:"html"`
	ImageURL   string `json:"imageURL"`
	HasContent bool   `json:"hasContent"`
	HasArchive bool   `json:"hasArchive"`
	Tags       []struct {
		Name string `json:"name"`
	} `json:"tags"`
	CreateArchive bool `json:"createArchive"`
}

type BookmarksResponse

type BookmarksResponse struct {
	Bookmarks []struct {
		Id         int    `json:"id"`
		Url        string `json:"url"`
		Title      string `json:"title"`
		Excerpt    string `json:"excerpt"`
		Author     string `json:"author"`
		Public     int    `json:"public"`
		Modified   string `json:"modified"`
		ImageURL   string `json:"imageURL"`
		HasContent bool   `json:"hasContent"`
		HasArchive bool   `json:"hasArchive"`
		Tags       []struct {
			Id   int    `json:"id"`
			Name string `json:"name"`
		} `json:"tags"`
		CreateArchive bool `json:"createArchive"`
	} `json:"bookmarks"`
	MaxPage int `json:"maxPage"`
	Page    int `json:"page"`
}

type LoginResponse

type LoginResponse struct {
	Session string `json:"session"`
	Account struct {
		Id       int    `json:"id"`
		Username string `json:"username"`
		Owner    bool   `json:"owner"`
	} `json:"account"`
}

type Shiori

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

func NewShiori

func NewShiori(endpoint string) *Shiori

func (*Shiori) AddBookmark

func (v *Shiori) AddBookmark(url, title string) (*BookmarkResponse, error)

func (*Shiori) DeleteBookmark

func (v *Shiori) DeleteBookmark(bookmarkIds []int) error

func (*Shiori) GetBookmarks

func (v *Shiori) GetBookmarks() (*BookmarksResponse, error)

func (*Shiori) Login

func (v *Shiori) Login(username string, password string) (*LoginResponse, error)

func (*Shiori) Logout

func (v *Shiori) Logout(sessionId string) error

Jump to

Keyboard shortcuts

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