rss

package
v0.0.0-...-0e2fbb9 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOperation

type DefaultOperation struct{}

DefaultOperation 默认值操作

func (*DefaultOperation) Process

func (op *DefaultOperation) Process(content string, defaultValue string) string

type ExtractOperation

type ExtractOperation struct{}

ExtractOperation 提取操作

func (*ExtractOperation) Process

func (op *ExtractOperation) Process(content string, params string) string

type Operation

type Operation interface {
	Process(content string, params string) string
}

Operation 定义模板操作接口

type OperationRegistry

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

OperationRegistry 操作注册表

func (*OperationRegistry) Register

func (r *OperationRegistry) Register(name string, op Operation)

Register 注册新的操作

type ReplaceOperation

type ReplaceOperation struct{}

ReplaceOperation 替换操作

func (*ReplaceOperation) Process

func (op *ReplaceOperation) Process(content string, params string) string

type RssHandler

type RssHandler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRssHandler

func NewRssHandler(cfg *config.Config, bot TelegramBot, store *storage.Storage) *RssHandler

func (*RssHandler) ExponentialBackoffWithJitter

func (h *RssHandler) ExponentialBackoffWithJitter(attempt int)

指数退避+随机抖动

func (*RssHandler) ProcessFeeds

func (h *RssHandler) ProcessFeeds() error

func (*RssHandler) UpdateConfig

func (h *RssHandler) UpdateConfig(cfg *config.Config)

type TelegramBot

type TelegramBot interface {
	Send(channel string, message string) error
}

type TemplateProcessor

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

TemplateProcessor 模板处理器

func NewTemplateProcessor

func NewTemplateProcessor() *TemplateProcessor

NewTemplateProcessor 创建新的模板处理器

func (*TemplateProcessor) ProcessField

func (p *TemplateProcessor) ProcessField(field, content string) string

ProcessField 处理模板字段

Jump to

Keyboard shortcuts

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