config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProjectName          string = "toshiki-rssbot"
	BotToken             string
	Socks5               string
	TelegraphToken       []string
	TelegraphAccountName string
	TelegraphAuthorName  string = "toshiki-rssbot"
	TelegraphAuthorURL   string

	// EnableTelegraph 是否启用telegraph
	EnableTelegraph       bool = false
	PreviewText           int  = 0
	DisableWebPagePreview bool = false

	SQLitePath  string
	EnableMysql bool = false

	// UpdateInterval RSS fetching interval
	UpdateInterval int = 10

	// ErrorThreshold Error threshold for RSS source fetching
	ErrorThreshold uint = 100

	// MessageTpl RSS update push template
	MessageTpl *template.Template

	// MessageMode Telegram message rendering mode
	MessageMode tb.ParseMode

	// TelegramEndpoint Telegram bot server address, default is empty
	TelegramEndpoint string = tb.DefaultApiURL

	// UserAgent User-Agent
	UserAgent string

	// RunMode Running mode Release / Debug
	RunMode RunType = ReleaseMode

	// AllowUsers Users allowed to use the bot
	AllowUsers []int64

	// DBLogMode Whether to print database logs
	DBLogMode bool = false
)

Functions

func AppVersionInfo

func AppVersionInfo() (s string)

func GetMysqlDSN

func GetMysqlDSN() string

func GetString

func GetString(key string) string

GetString get string config value by key

Types

type RunType

type RunType string
const (
	TestMode    RunType = "Test"
	ReleaseMode RunType = "Release"
)

type TplData

type TplData struct {
	SourceTitle     string
	ContentTitle    string
	RawLink         string
	PreviewText     string
	TelegraphURL    string
	Tags            string
	EnableTelegraph bool
}

func (TplData) Render

func (t TplData) Render(mode tb.ParseMode) (string, error)

Jump to

Keyboard shortcuts

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