Documentation
¶
Index ¶
Constants ¶
const RecordingHeader = "🎓 Записи занятий"
RecordingHeader is the marker line the bot uses for recording posts.
Variables ¶
This section is empty.
Functions ¶
func FormatLine ¶
FormatLine is a compact one-line summary used in pickers.
Types ¶
type Permalinker ¶
Permalinker turns a post ID into a chat permalink. Optional — usecase works without it, recordings just won't have PostURL filled.
type PostSource ¶
PostSource is implemented by any store that can hand back the posts to scan. The implementation is free to read from local cache or remote API.
type Recording ¶
type Recording struct {
PostID string
PostURL string // mattermost permalink to the source post, optional
PostedAt time.Time // post create time
Date time.Time // lesson date (day precision); zero if not parsed
Subject string // "Пара:" value
StartTime string // "HH:MM" or empty
EndTime string // "HH:MM" or empty
Links []RecordingLink
}
Recording is one extracted lesson recording.
type RecordingLink ¶
type RecordingLink struct {
URL string
Size string // raw size string from the bot, e.g. "24,9 МБ"; empty if missing
}
RecordingLink is a single playback/download URL.
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase wraps a PostSource with parsing + search logic.
func New ¶
func New(src PostSource) *UseCase
func (*UseCase) ForCourse ¶
ForCourse is a convenience wrapper over Search intended for course summaries: matches recordings whose subject contains the course name.
func (*UseCase) Search ¶
Search returns recordings whose subject contains query (case-insensitive). An empty query returns all recordings.
func (*UseCase) WithPermalinker ¶
func (uc *UseCase) WithPermalinker(p Permalinker) *UseCase
WithPermalinker attaches a Permalinker so parsed recordings carry PostURL.