Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct { ExporterParams // contains filtered or unexported fields }
Exporter performs conversion from log file to html
func NewExporter ¶
func NewExporter(fileRecipient FileRecipient, storage Storage, params ExporterParams) *Exporter
NewExporter from params, initializes time.Location
type ExporterParams ¶
type ExporterParams struct { OutputRoot string InputRoot string TemplateFile string BotUsername string SuperUsers SuperUser BroadcastUsers SuperUser // Users who can send "bot.MsgBroadcastStarted" and "bot.MsgBroadcastStarted" messages. }
ExporterParams for locations
type FileRecipient ¶
type FileRecipient interface {
GetFile(fileID string) (io.ReadCloser, error)
}
FileRecipient knows how to get file by fileID Needed mainly for tests to mock
func NewTelegramFileRecipient ¶
func NewTelegramFileRecipient(botAPI *tbapi.BotAPI, timeout time.Duration) FileRecipient
NewTelegramFileRecipient creates TelegramFileRecipient
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter collects all messages and saves to plain file
type Storage ¶
type Storage interface { FileExists(fileName string) (bool, error) CreateFile(fileName string, body []byte) (string, error) BuildLink(fileName string) string BuildPath(fileName string) string }
Storage knows how to: create file, check for file existence and build a public-accessible link (relative in our case)
type TelegramFileRecipient ¶
type TelegramFileRecipient struct {
// contains filtered or unexported fields
}
TelegramFileRecipient implements FileRecipient for Telegram files
func (TelegramFileRecipient) GetFile ¶
func (tfd TelegramFileRecipient) GetFile(fileID string) (io.ReadCloser, error)
GetFile gets file from Telegram
Click to show internal directories.
Click to hide internal directories.