Documentation ¶
Index ¶
- func PaywallButton(feedID feed.ID, subreddit, thingID string) telegram.Button
- func PreferenceButtons(subreddit, thingID string, likes, dislikes int64, paywall bool) []telegram.Button
- type Score
- type Storage
- type StorageInterface
- type StorageTx
- type Subreddit
- func (v *Subreddit[C]) BeforeResume(ctx context.Context, header feed.Header) error
- func (v *Subreddit[C]) Include(ctx context.Context, app apfel.MixinApp[C]) error
- func (v *Subreddit[C]) Parse(ctx context.Context, ref string, options []string) (*feed.Draft, error)
- func (v *Subreddit[C]) Refresh(ctx context.Context, header feed.Header, refresh feed.Refresh) error
- func (v *Subreddit[C]) String() string
- type SubredditConfig
- type SubredditContext
- type SubredditData
- type SubredditEventData
- type SubredditPacingConfig
- type SubredditSuggestions
- func (v *SubredditSuggestions[C]) Include(ctx context.Context, app apfel.MixinApp[C]) error
- func (v *SubredditSuggestions[C]) Parse(ctx context.Context, ref string, options []string) (*feed.Draft, error)
- func (v *SubredditSuggestions[C]) Refresh(ctx context.Context, header feed.Header, refresh feed.Refresh) error
- func (v SubredditSuggestions[C]) String() string
- type SubredditSuggestionsConfig
- type SubredditSuggestionsContext
- type SubredditSuggestionsData
- type ThingLayout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PaywallButton ¶
func PreferenceButtons ¶
Types ¶
type Storage ¶
type Storage[C core.StorageContext] struct { StorageInterface }
type StorageInterface ¶
type Subreddit ¶
type Subreddit[C SubredditContext] struct { // contains filtered or unexported fields }
func (*Subreddit[C]) BeforeResume ¶
type SubredditConfig ¶
type SubredditConfig struct { Pacing SubredditPacingConfig `yaml:"pacing,omitempty" doc:"Settings for controlling pacing based on top ratio."` CleanInterval flu.Duration `yaml:"cleanInterval,omitempty" doc:"How often to clean things from data." default:"24h"` ThingTTL flu.Duration `yaml:"thingTtl,omitempty" doc:"How long to keep things in database." default:"168h"` }
type SubredditContext ¶
type SubredditContext interface { reddit.Context core.MediatorContext core.StorageContext tapp.Context SubredditConfig() SubredditConfig }
type SubredditData ¶
type SubredditEventData ¶
type SubredditEventData struct { UserID telegram.ID `json:"user_id" delete:"user_id" count:"-" pre:"user_id"` MessageID telegram.ID `json:"message_id" delete:"message_id" count:"message_id" pre:"-"` Subreddit string `json:"subreddit" delete:"-" count:"-" pre:"-"` ThingID string `json:"thing_id" delete:"-" count:"-" pre:"thing_id"` }
type SubredditPacingConfig ¶
type SubredditPacingConfig struct { Gain flu.Duration `yaml:"gain,omitempty" doc:"Do not apply pacing during this interval since subscription start." default:"48h"` Base float64 `yaml:"base,omitempty" doc:"Base top ratio to be applied for stable subscriptions." default:"0.01"` Min float64 `yaml:"min,omitempty" doc:"Lowest allowed top ratio."` Scale float64 `` /* 126-byte string literal not displayed */ Members int64 `yaml:"members,omitempty" doc:"Lowest chat members threshold." default:"300"` Batch int `yaml:"batch,omitempty" doc:"Max update batch size." default:"1"` }
type SubredditSuggestions ¶
type SubredditSuggestions[C SubredditSuggestionsContext] struct { // contains filtered or unexported fields }
func (SubredditSuggestions[C]) String ¶
func (v SubredditSuggestions[C]) String() string
type SubredditSuggestionsContext ¶
type SubredditSuggestionsContext interface { tapp.Context core.StorageContext core.InterfaceContext SubredditSuggestionsConfig() SubredditSuggestionsConfig }
type ThingLayout ¶
type ThingLayout struct { HideSubreddit bool `json:"hide_subreddit,omitempty"` HideLink bool `json:"hide_link,omitempty"` ShowAuthor bool `json:"show_author,omitempty"` HideTitle bool `json:"hide_title,omitempty"` ShowText bool `json:"show_text,omitempty"` HideMedia bool `json:"hide_media,omitempty"` HideMediaLink bool `json:"hide_media_link,omitempty"` ShowPaywall bool `json:"show_paywall,omitempty"` ShowPreference bool `json:"show_preference,omitempty"` }
Click to show internal directories.
Click to hide internal directories.