comigo_remote

package
v1.2.38 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RemoteStoreQuery = "remote_store"

Variables

This section is empty.

Functions

func LocalBookID

func LocalBookID(storeURL string, remoteBookID string) string

LocalBookID 根据远端书库和远端 BookID 生成本机 BookID,避免跨书库冲突。

func LocalCoverURL

func LocalCoverURL(localBookID string, remoteStoreKey string, _ string) string

LocalCoverURL 生成本机封面代理 URL。

func LocalFileURL

func LocalFileURL(localBookID string, remoteStoreKey string, page model.PageInfo) string

LocalFileURL 生成本机图片代理 URL。

func LocalizeBook

func LocalizeBook(storeURL string, remoteBook *model.Book) *model.Book

LocalizeBook 把远端书籍元数据转换成本机书库中的远程书籍元数据。

func LocalizeBookInShelf

func LocalizeBookInShelf(storeURL string, remoteBook *model.Book, shelfKey string, shelfName string) *model.Book

LocalizeBookInShelf 把远端书籍放进指定的远端顶级书库分组。

func MatchStoreByKey

func MatchStoreByKey(storeURLs []string, key string) (string, error)

MatchStoreByKey 从当前配置的书库列表中找到 remote_store 对应的远端 Comigo URL。

func PublicBaseURL

func PublicBaseURL(storeURL string) (string, error)

PublicBaseURL 返回不含账号密码的远端 Comigo 主页 URL。

func ResolveBook

func ResolveBook(storeURLs []string, remoteStoreKey string, localBookID string, sortBy string, timeoutSeconds int) (*model.Book, bool, error)

ResolveBook 根据本机 BookID 和 remote_store 参数实时获取远端书籍详情。

func ShelfKey

func ShelfKey(storeURL string, shelf model.StoreBookInfo, index int) string

ShelfKey 生成远端顶级书库的本地内部标识。 旧版 Comigo top-shelf 不输出真实 StoreUrl,只能用远端主页、顺序和显示名稳定区分。

func StoreKey

func StoreKey(storeURL string) (string, error)

StoreKey 生成公开、稳定、短于原始 URL 的远端书库标识。

Types

type Client

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

Client 访问另一个 Comigo 服务,负责登录态和 BasePath 拼接。

func NewClient

func NewClient(storeURL string, timeoutSeconds int) (*Client, error)

NewClient 创建远端 Comigo 客户端。URL 中的 userinfo 用于远端登录。

func (*Client) Delete

func (c *Client) Delete(apiPath string, query url.Values) ([]byte, string, error)

Delete 代理远端 DELETE。

func (*Client) GetAllBookmarks

func (c *Client) GetAllBookmarks() ([]model.BookinfoWithBookMark, error)

GetAllBookmarks 获取远端所有书签。

func (*Client) GetBook

func (c *Client) GetBook(remoteBookID string, sortBy string) (*model.Book, error)

GetBook 获取远端书籍详情。

func (*Client) GetBytes

func (c *Client) GetBytes(apiPath string, query url.Values) ([]byte, string, error)

GetBytes 代理远端二进制 API。

func (*Client) GetResponse

func (c *Client) GetResponse(apiPath string, query url.Values, headers http.Header) (*http.Response, error)

GetResponse 流式代理远端 GET 响应,供音视频等需要 Range 的原始资源使用。

func (*Client) GetServerVersion

func (c *Client) GetServerVersion() (string, error)

GetServerVersion 获取远端 Comigo 版本;兼容旧服务只在 ServerName 中带版本号的响应。

func (*Client) GetTopShelf

func (c *Client) GetTopShelf(sortBy string) ([]model.StoreBookInfo, error)

GetTopShelf 获取远端顶层书架。

func (*Client) PostJSON

func (c *Client) PostJSON(apiPath string, payload []byte) ([]byte, string, error)

PostJSON 代理远端 JSON POST。

Jump to

Keyboard shortcuts

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