Documentation ¶
Index ¶
- func CreateJsonCookieJar(l core.Logger, cookieFile string) http.CookieJar
- func CreateTikTokMediaFactory(api YoutubeApi) core.IMediaFactory
- func NewLightsailAPI(logger core.Logger, accessKeyId, secretAccessKey string) legacy.ServerAPI
- type CoreFactory
- type Entity
- type Error
- type GraphQLResponse
- type GraphQLResponseCore
- type GraphQLResponseData
- type GraphQLResponseTweetResult
- type GraphQLResponseTweetResultResult
- type GraphQLResponseUserResult
- type GraphQLResponseUserResults
- type GraphQLVariables
- type HttpClient
- type JsonCookieJar
- type LightsailAPI
- type Media
- type OutlineAPI
- type OutlineAPIKeys
- type Telebot
- type TelebotAdapter
- func (a *TelebotAdapter) Delete(message *core.Message) error
- func (a *TelebotAdapter) Edit(message *core.Message, what interface{}, options ...interface{}) (*core.Message, error)
- func (a *TelebotAdapter) GetCommands(chatID int64) ([]core.Command, error)
- func (a *TelebotAdapter) IsUserMemberOfChat(user *core.User, chatID int64) bool
- func (a *TelebotAdapter) SendAlbum(images []*core.Image) ([]*core.Message, error)
- func (a *TelebotAdapter) SendImage(image *core.Image, caption string) (*core.Message, error)
- func (a *TelebotAdapter) SendMedia(media *core.Media) (*core.Message, error)
- func (a *TelebotAdapter) SendMediaAlbum(medias []*core.Media) ([]*core.Message, error)
- func (a *TelebotAdapter) SendText(text string, params ...interface{}) (*core.Message, error)
- func (a *TelebotAdapter) SendVideo(vf *core.Video, caption string) (*core.Message, error)
- func (a *TelebotAdapter) SetCommands(chatID int64, commands []core.Command) error
- type TelebotConfig
- type TelebotConfigOption
- type Telegraph
- type TikTokMediaFactory
- type Tweet
- type TweetScreenshot
- type TwitterAPI
- type TwitterApiCredentials
- type TwitterMediaFactory
- type URL
- type User
- type VideoInfo
- type VideoInfoVariant
- type VpnKey
- type YoutubeApi
- type YoutubeMediaFactory
- type YtDlpApi
- type YtDlpFormat
- type YtDlpResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJsonCookieJar ¶
func CreateTikTokMediaFactory ¶
func CreateTikTokMediaFactory(api YoutubeApi) core.IMediaFactory
Types ¶
type CoreFactory ¶
type CoreFactory struct { }
type GraphQLResponse ¶
type GraphQLResponse struct { Errors []Error `json:"errors,omitempty"` Data GraphQLResponseData `json:"data"` }
type GraphQLResponseCore ¶
type GraphQLResponseCore struct {
UserResults GraphQLResponseUserResults `json:"user_results"`
}
type GraphQLResponseData ¶
type GraphQLResponseData struct {
TweetResult GraphQLResponseTweetResult `json:"tweetResult"`
}
type GraphQLResponseTweetResult ¶
type GraphQLResponseTweetResult struct {
Result GraphQLResponseTweetResultResult `json:"result"`
}
type GraphQLResponseTweetResultResult ¶
type GraphQLResponseTweetResultResult struct { Core GraphQLResponseCore `json:"core"` Legacy Tweet `json:"legacy"` RestId string `json:"rest_id"` }
type GraphQLResponseUserResults ¶
type GraphQLResponseUserResults struct {
Result GraphQLResponseUserResult `json:"result"`
}
type GraphQLVariables ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func CreateHttpClient ¶
func CreateHttpClient() *HttpClient
func (*HttpClient) GetContent ¶
func (c *HttpClient) GetContent(url core.URL) (string, error)
GetContent is a core.IHttpClient interface implementation
func (*HttpClient) GetContentType ¶
func (c *HttpClient) GetContentType(url core.URL) (string, error)
GetContentType is a core.IHttpClient interface implementation
func (*HttpClient) GetRedirectLocation ¶
func (*HttpClient) SetHeader ¶
func (c *HttpClient) SetHeader(key string, value string)
SetHeader remembers all passed values and applies it to every request
type JsonCookieJar ¶
type JsonCookieJar struct {
// contains filtered or unexported fields
}
func (*JsonCookieJar) SetCookies ¶
func (jar *JsonCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)
type LightsailAPI ¶
type LightsailAPI struct {
// contains filtered or unexported fields
}
func (*LightsailAPI) GetServers ¶
func (*LightsailAPI) RebootServer ¶
type Media ¶
type Media struct { MediaUrlHttps string `json:"media_url_https"` Type string `json:"type"` VideoInfo VideoInfo `json:"video_info,omitempty"` }
Media ...
type OutlineAPI ¶
type OutlineAPI struct {
// contains filtered or unexported fields
}
func CreateOutlineAPI ¶
func CreateOutlineAPI(l core.Logger, url string) *OutlineAPI
CreateOutlineAPI is a default OutlineAPI factory
type OutlineAPIKeys ¶
type OutlineAPIKeys struct {
AccessKeys []*VpnKey
}
type Telebot ¶
type Telebot struct {
// contains filtered or unexported fields
}
Telebot is a telegram API
func CreateTelebot ¶
func CreateTelebot(logger core.Logger, opts ...TelebotConfigOption) *Telebot
CreateTelebot is a default Telebot factory
func (*Telebot) AddHandler ¶
func (t *Telebot) AddHandler(handler ...interface{})
AddHandler register object as one of core.Handler's
type TelebotAdapter ¶
type TelebotAdapter struct {
// contains filtered or unexported fields
}
TelebotAdapter combines Telebot and core.IBot
func (*TelebotAdapter) Delete ¶
func (a *TelebotAdapter) Delete(message *core.Message) error
Delete is a core.IBot interface implementation
func (*TelebotAdapter) Edit ¶
func (a *TelebotAdapter) Edit(message *core.Message, what interface{}, options ...interface{}) (*core.Message, error)
Edit is a core.IBot interface implementation
func (*TelebotAdapter) GetCommands ¶
func (a *TelebotAdapter) GetCommands(chatID int64) ([]core.Command, error)
GetCommands is a core.IBot interface implementation
func (*TelebotAdapter) IsUserMemberOfChat ¶
func (a *TelebotAdapter) IsUserMemberOfChat(user *core.User, chatID int64) bool
IsUserMemberOfChat is a core.IBot interface implementation
func (*TelebotAdapter) SendMediaAlbum ¶
SendMediaAlbum is a core.IBot interface implementation
func (*TelebotAdapter) SendText ¶
func (a *TelebotAdapter) SendText(text string, params ...interface{}) (*core.Message, error)
SendText is a core.IBot interface implementation
func (*TelebotAdapter) SetCommands ¶
func (a *TelebotAdapter) SetCommands(chatID int64, commands []core.Command) error
SetCommands is a core.IBot interface implementation
type TelebotConfig ¶
type TelebotConfigOption ¶
type TelebotConfigOption func(*TelebotConfig)
func WithBotAPIUrl ¶
func WithBotAPIUrl(url string) TelebotConfigOption
func WithBotToken ¶
func WithBotToken(token string) TelebotConfigOption
func WithReportChatId ¶
func WithReportChatId(chatId int64) TelebotConfigOption
type Telegraph ¶
type Telegraph struct { }
Telegraph uploads files to telegra.ph
func CreateTelegraphAPI ¶
func CreateTelegraphAPI() *Telegraph
CreateTelegraphAPI is a default Telegraph factory
type TikTokMediaFactory ¶
type TikTokMediaFactory struct {
// contains filtered or unexported fields
}
func (*TikTokMediaFactory) CreateMedia ¶
func (factory *TikTokMediaFactory) CreateMedia(url string) ([]*core.Media, error)
type Tweet ¶
type Tweet struct { ID string `json:"id_str"` FullText string `json:"full_text"` Entities Entity `json:"entities"` ExtendedEntities Entity `json:"extended_entities,omitempty"` User User `json:"user,omitempty"` QuotedStatus *Tweet `json:"quoted_status,omitempty"` Errors []Error `json:"errors,omitempty"` }
Tweet is a twitter api representation of a single tweet
type TweetScreenshot ¶
type TwitterAPI ¶
type TwitterAPI struct {
// contains filtered or unexported fields
}
Twitter API
func CreateTwitterAPI ¶
func CreateTwitterAPI(l core.Logger, t legacy.ITask) *TwitterAPI
CreateTwitterAPI is a default Twitter factory
type TwitterApiCredentials ¶
type TwitterApiCredentials struct {
// contains filtered or unexported fields
}
type TwitterMediaFactory ¶
type TwitterMediaFactory struct {
// contains filtered or unexported fields
}
func CreateTwitterMediaFactory ¶
func CreateTwitterMediaFactory(l core.Logger, t legacy.ITask) *TwitterMediaFactory
func (*TwitterMediaFactory) CreateMedia ¶
func (tmf *TwitterMediaFactory) CreateMedia(tweetID string) ([]*legacy.Media, error)
CreateMedia is a core.IMediaFactory interface implementation
type VideoInfo ¶
type VideoInfo struct { Duration uint `json:"duration_millis"` Variants []VideoInfoVariant `json:"variants"` }
VideoInfo ...
type VideoInfoVariant ¶
type VideoInfoVariant struct { Bitrate int `json:"bitrate"` ContentType string `json:"content_type"` URL string `json:"url"` }
VideoInfoVariant ...
type YoutubeApi ¶
type YoutubeApi interface {
Get(string) (*YtDlpResponse, error)
}
func CreateYtDlpApi ¶
func CreateYtDlpApi(args []string, l core.Logger) YoutubeApi
type YoutubeMediaFactory ¶
type YoutubeMediaFactory struct {
// contains filtered or unexported fields
}
func CreateYoutubeMediaFactory ¶
func CreateYoutubeMediaFactory(l core.Logger, api YoutubeApi, fd legacy.IFileDownloader) *YoutubeMediaFactory
func (*YoutubeMediaFactory) CreateMedia ¶
func (y *YoutubeMediaFactory) CreateMedia(url string) ([]*legacy.Media, error)
CreateMedia is a core.IMediaFactory interface implementation
func (*YoutubeMediaFactory) CreateVideo ¶
func (y *YoutubeMediaFactory) CreateVideo(id string) (*legacy.Video, error)
CreateVideo is a core.IVideoFactory interface implementation
type YtDlpFormat ¶
type YtDlpFormat struct { Ext string `json:"ext"` FormatId string `json:"format_id"` Format string `json:"format"` FormatNote string `json:"format_note"` Filesize int64 `json:"filesize,omitempty"` Height int `json:"height"` Width int `json:"width"` Acodec string `json:"acodec"` Vcodec string `json:"vcodec"` Url string `json:"url"` }
type YtDlpResponse ¶
type YtDlpResponse struct { Id string `json:"id"` Title string `json:"title"` Description string `json:"description"` Creator string `json:"creator,omitempty"` // tiktok Track string `json:"track,omitempty"` // tiktok Artist string `json:"artist,omitempty"` // tiktok Duration float64 `json:"duration"` ExtractorKey string `json:"extractor_key"` Thumbnail string `json:"thumbnail"` Uploader string `json:"uploader"` Url string `json:"url,omitempty"` Formats []*YtDlpFormat `json:"formats"` }