Documentation
¶
Index ¶
- Constants
- func DebugHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func MeHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- type BotContext
- type CommandsHandler
- func (c *CommandsHandler) AddAlarmKeywordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) AddKeywordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) AlarmRecordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) ConvertURLToIMGHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) ConvertURLToPDFHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) DeleteKeywordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) EditKeywordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) HandleCallbackQuery(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) ListTodayHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) SearchAlarmRecordHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) SearchHistoryHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- func (c *CommandsHandler) StaticHandler(ctx context.Context, b *bot.Bot, update *models.Update)
- type Crawler
- type GotenbergClient
- type InfoProcessor
- type MagnetHandler
- type ManagerHandler
- type ProcessData
- type Project
- type Projects
- type Store
Constants ¶
View Source
const ( BestUrlFile = "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt" BestFile = "trackers_best.txt" )
View Source
const DefaultCacheDuration = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func DebugHandler ¶ added in v1.4.2
Types ¶
type BotContext ¶ added in v1.4.1
type BotContext struct {
Bot *bot.Bot
Store *Store
Logger *utils.Logger
Config *config.ServiceConfig
Gotenberg *GotenbergClient
// contains filtered or unexported fields
}
func NewBotContext ¶ added in v1.4.1
func NewBotContext() (*BotContext, error)
func (*BotContext) Start ¶ added in v1.4.1
func (ctx *BotContext) Start()
func (*BotContext) Stop ¶ added in v1.4.1
func (ctx *BotContext) Stop()
type CommandsHandler ¶
type CommandsHandler struct {
// contains filtered or unexported fields
}
func NewCommandsHandler ¶
func NewCommandsHandler(ctx *BotContext) *CommandsHandler
func (*CommandsHandler) AddAlarmKeywordHandler ¶ added in v1.2.0
func (*CommandsHandler) AddKeywordHandler ¶
func (*CommandsHandler) AlarmRecordHandler ¶ added in v1.4.2
func (*CommandsHandler) ConvertURLToIMGHandler ¶ added in v1.4.1
func (*CommandsHandler) ConvertURLToPDFHandler ¶ added in v1.3.0
func (*CommandsHandler) DeleteKeywordHandler ¶
func (*CommandsHandler) EditKeywordHandler ¶ added in v1.4.0
func (*CommandsHandler) HandleCallbackQuery ¶ added in v1.3.0
func (*CommandsHandler) ListTodayHandler ¶ added in v1.4.7
func (*CommandsHandler) SearchAlarmRecordHandler ¶ added in v1.4.2
func (*CommandsHandler) SearchHistoryHandler ¶ added in v1.3.0
func (*CommandsHandler) StaticHandler ¶ added in v1.4.0
type Crawler ¶ added in v1.4.1
type Crawler struct {
// contains filtered or unexported fields
}
func NewCrawler ¶ added in v1.4.1
func NewCrawler(ctx *BotContext) *Crawler
type GotenbergClient ¶ added in v1.4.1
type GotenbergClient struct {
// contains filtered or unexported fields
}
func NewGotenbergClient ¶ added in v1.4.1
func NewGotenbergClient(host string, hookURL string) (*GotenbergClient, error)
func (*GotenbergClient) HtmlToImage ¶ added in v1.4.1
func (g *GotenbergClient) HtmlToImage(content string) (string, error)
func (*GotenbergClient) URLToImage ¶ added in v1.4.1
func (g *GotenbergClient) URLToImage(u string) (string, error)
type InfoProcessor ¶ added in v1.4.1
type InfoProcessor struct {
// contains filtered or unexported fields
}
func NewInfoProcessor ¶ added in v1.4.1
func NewInfoProcessor(ctx *BotContext) (*InfoProcessor, error)
func (*InfoProcessor) Get ¶ added in v1.4.1
func (r *InfoProcessor) Get(userId int64)
func (*InfoProcessor) Handler ¶ added in v1.4.2
func (r *InfoProcessor) Handler(i interface{})
func (*InfoProcessor) Process ¶ added in v1.4.1
func (r *InfoProcessor) Process()
func (*InfoProcessor) Release ¶ added in v1.4.1
func (r *InfoProcessor) Release()
type MagnetHandler ¶
type MagnetHandler struct {
// contains filtered or unexported fields
}
func NewMagnetHandler ¶
func NewMagnetHandler(ctx *BotContext) *MagnetHandler
type ManagerHandler ¶
type ManagerHandler struct {
// contains filtered or unexported fields
}
func NewManagerHandler ¶
func NewManagerHandler(ctx *BotContext) *ManagerHandler
type ProcessData ¶ added in v1.4.1
type ProcessData struct {
UserId int64
ProjectRules []*rule.ComplexRule
AlarmKeyword []string
Projects []*Project
Alarms []*model.Alarm
IsForced bool
}
ProcessData holds the data for processing
type Project ¶ added in v1.4.1
type Project struct {
NoticeTime string `json:"noticeTime,omitempty"`
OpenTenderCode string `json:"openTenderCode,omitempty"`
Title string `json:"title,omitempty"`
ShortTitle string `json:"-"`
Content string `json:"content,omitempty"`
Pageurl string `json:"pageurl,omitempty"`
Keyword string `json:"keyword,omitempty"`
HasTenderCode bool `json:"-"`
}
func (*Project) SplitMessage ¶ added in v1.4.2
type Projects ¶ added in v1.4.1
type Projects struct {
Projects []*Project
// contains filtered or unexported fields
}
func NewProjects ¶ added in v1.4.1
func NewProjects(ctx *BotContext, projects []*Project, rules []*rule.ComplexRule) *Projects
Click to show internal directories.
Click to hide internal directories.