desktop

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 47 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package desktop 绘制原生工作台并连接本机 Runtime Server。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Desktop

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

Desktop 在窗口主线程持有阅读内容、编辑草稿和界面选择。

func NewDesktop

func NewDesktop(opt *DesktopOpt) (*Desktop, error)

NewDesktop 校验并保存桌面启动参数。

func (*Desktop) Run

func (d *Desktop) Run(ctx context.Context) error

Run 在主 goroutine 运行窗口,退出后取消并等待桌面任务。

type DesktopOpt

type DesktopOpt struct {
	RuntimeServerStart cli.RuntimeServerStartOpt
	PreferencesPath    string
	// HTTPHeaders 是配置里的 http.headers(已合并内置默认);原生界面自己下载 Markdown 里的网络图片时带上。
	HTTPHeaders map[string]string
}

DesktopOpt 指定本机服务启动参数、可选的偏好文件路径和图片下载带的 header。

type WebViewDesktop

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

WebViewDesktop 使用系统 WebView 显示本机 serve 的 WebUI。

func NewWebViewDesktop

func NewWebViewDesktop(opt *WebViewDesktopOpt) (*WebViewDesktop, error)

NewWebViewDesktop 校验并保存 WebView 桌面的启动参数。

func (*WebViewDesktop) Run

func (d *WebViewDesktop) Run(ctx context.Context) error

Run 连接本机服务,在主 goroutine 运行 WebView 窗口并等待本进程任务退出。

type WebViewDesktopOpt

type WebViewDesktopOpt struct {
	RuntimeServerStart cli.RuntimeServerStartOpt
}

WebViewDesktopOpt 指定 WebUI 使用的本机服务启动参数。

Jump to

Keyboard shortcuts

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