web

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

「我的阅读」页 API:体验卡活动的自动领取开关与调度。

「阅读挑战」页 API:官方挑战赛的进度查询、报名与自动参与。

日志查询 API 与 Server 级别的统一日志入口:写 SQLite(供日志页查看)+ 打到进程 stdout。

推送设置的 API 层:四类渠道固定平铺,按类型读写配置、发送测试、广播会话结果。

阅读挑战的 API 层:配置读写、立即执行、以及 serve 进程内的每日调度器。

Package web 提供账号管理与阅读任务 API。

「我的阅读」页 API:周阅读奖励的查询、领取与自动领取预约。

Index

Constants

View Source
const Version = "0.4.6"

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server 是 Web UI 的 HTTP 服务。

func New

func New(db *sql.DB) *Server

func (*Server) Close

func (s *Server) Close()

Close 先结束后台阅读会话,保留断点后再允许调用方关闭数据库。

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) ResumeInterrupted

func (s *Server) ResumeInterrupted()

ResumeInterrupted 在服务启动时仅续跑进程异常退出后留下的当日未完成会话。 用户主动停止或上报失败会清除断点,并视为当日任务结束。

func (*Server) StartChallengeAutoJoinScheduler added in v0.2.1

func (s *Server) StartChallengeAutoJoinScheduler(ctx context.Context)

StartChallengeAutoJoinScheduler 启动挑战自动参与循环:启动 1 分钟后首轮, 此后每 5 分钟扫描开启开关的账号。与周奖励调度器同模式,独立成环互不阻塞。

func (*Server) StartFarmScheduler

func (s *Server) StartFarmScheduler(ctx context.Context)

StartFarmScheduler 启动每日调度循环:每 30 秒扫描一次启用了阅读挑战的账号, 到达当日执行时间且今天还没跑过的就开一场阅读会话。错过时间点(如进程 中午才启动、计划在凌晨)会在启动后补跑当日场次。

func (*Server) StartSendInfiniteScheduler added in v0.3.0

func (s *Server) StartSendInfiniteScheduler(ctx context.Context)

StartSendInfiniteScheduler 启动体验卡活动自动领取循环:启动 2 分钟后首轮, 此后每 30 分钟扫描一遍开启开关的账号。活动按天重置,半小时粒度足够及时。

func (*Server) StartWeeklyClaimScheduler

func (s *Server) StartWeeklyClaimScheduler(ctx context.Context)

StartWeeklyClaimScheduler 启动自动领取循环:启动 30 秒后首轮,此后每 5 分钟 扫描一遍有预约的账号,奖励一旦达成(status=1)即按预约自动领取并记日志。

Jump to

Keyboard shortcuts

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