Documentation ¶
Index ¶
- Variables
- func GetKey() [16]byte
- func Header(tag string) string
- func LoadConfig()
- func NoMoreContent() dandelion.InlineQueryResultArticle
- func Pagination(current, total, count int64) string
- func SwitchMode(mode string) string
- func UpdateKey() [16]byte
- type Configuration
- func (c Configuration) DSN() string
- func (c Configuration) IsPostgreSQL() bool
- func (c Configuration) IsSQLite() bool
- func (c Configuration) IsWebhook() bool
- func (c Configuration) LogFolder() string
- func (c Configuration) StaticFolder() string
- func (c Configuration) TemplatesFolder() string
- func (c Configuration) Webhook() string
- type Input
- type Mode
- type Note
- func (n *Note) Description() string
- func (n *Note) HTML() template.HTML
- func (n *Note) InlineQueryResultArticle() dandelion.InlineQueryResultArticle
- func (n *Note) List() string
- func (n *Note) MarkdownLink() string
- func (n *Note) ParticipleContent() string
- func (n *Note) ParticipleTitle() string
- func (n *Note) PreviewLink() string
- func (n *Note) ShareLink() string
- func (n *Note) ViewLink() string
- type Token
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Username = `aoangc`
)
Functions ¶
func LoadConfig ¶
func LoadConfig()
func NoMoreContent ¶
func NoMoreContent() dandelion.InlineQueryResultArticle
func Pagination ¶
func SwitchMode ¶
Types ¶
type Configuration ¶
type Configuration struct { Database string `json:"database"` // pg sqlite 目前仅支持,看编译的啥,数据库地址 Domain string `json:"domain"` // 域名,如果不填写,默认为监听地址 ListenAddr string `json:"listen_addr"` // 监听地址,默认为 :8088 DataFolder string `json:"data_folder"` // 数据文件夹 默认 /data/memo/ LogLevel string `json:"log_level"` // log 等级 TelegramID int64 `json:"telegram_id"` // 用户的 Telegram ID TelegramToken string `json:"telegram_token"` // telegram bot token TelegramWebhook string `json:"telegram_webhook"` // 默认地址 /api/v1/telegram/bot/webhook Token struct { AutoUpdate uint32 `json:"auto_update"` // 自动更新 key 的时间,单位 分钟。为零不自动更新 Preview uint32 `json:"preview"` // 预览的有效时间。为零不过期 View uint32 `json:"view"` // 阅读的有效时间 Share uint32 `json:"share"` // 分享的有效时间 } `json:"token"` }
var Conf Configuration
func (Configuration) DSN ¶
func (c Configuration) DSN() string
func (Configuration) IsPostgreSQL ¶
func (c Configuration) IsPostgreSQL() bool
func (Configuration) IsSQLite ¶
func (c Configuration) IsSQLite() bool
func (Configuration) IsWebhook ¶
func (c Configuration) IsWebhook() bool
func (Configuration) LogFolder ¶
func (c Configuration) LogFolder() string
func (Configuration) StaticFolder ¶
func (c Configuration) StaticFolder() string
func (Configuration) TemplatesFolder ¶
func (c Configuration) TemplatesFolder() string
func (Configuration) Webhook ¶
func (c Configuration) Webhook() string
type Note ¶
type Note struct { ID uint64 `gorm:"primaryKey" json:"id" ` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` Title string `json:"title"` // 标题 Content string `json:"content"` // 内容 }
func (*Note) Description ¶
func (*Note) InlineQueryResultArticle ¶
func (n *Note) InlineQueryResultArticle() dandelion.InlineQueryResultArticle
func (*Note) MarkdownLink ¶
func (*Note) ParticipleContent ¶
func (*Note) ParticipleTitle ¶
func (*Note) PreviewLink ¶
type Token ¶
func ParseToken ¶
Click to show internal directories.
Click to hide internal directories.