service

package
v0.0.0-...-ea02315 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidURL    = fmt.Errorf("invalid url")
	ErrNotFound      = fmt.Errorf("not found")
	ErrVideoNotFound = fmt.Errorf("video not found")
)

Functions

This section is empty.

Types

type TelegramMessageHandler

type TelegramMessageHandler struct {
	// contains filtered or unexported fields
}

func NewMessageHandler

func NewMessageHandler(conf *config.Config, vs *VideoService) *TelegramMessageHandler

func (*TelegramMessageHandler) OnCallback

func (h *TelegramMessageHandler) OnCallback(userbotClient *telegram.UserBotClient) telebot.HandlerFunc

func (*TelegramMessageHandler) OnNewMessage

func (h *TelegramMessageHandler) OnNewMessage() telebot.HandlerFunc

func (*TelegramMessageHandler) OnStart

func (h *TelegramMessageHandler) OnStart() telebot.HandlerFunc

type VideoService

type VideoService struct {
	// contains filtered or unexported fields
}

func NewVideoService

func NewVideoService(maxRetry uint, repo *repository.InMemRepository) (*VideoService, error)

func (*VideoService) DownloadVideo

func (s *VideoService) DownloadVideo(ctx context.Context, videoOption *models.VideoOption) (string, error)

func (*VideoService) GetVideoInfo

func (s *VideoService) GetVideoInfo(ctx context.Context, url string) (*models.VideoInfo, *fastjson.Value, error)

func (*VideoService) GetVideoOptions

func (s *VideoService) GetVideoOptions(videoInfo *models.VideoInfo, json *fastjson.Value) ([]*models.VideoOption, error)

Jump to

Keyboard shortcuts

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