Documentation
¶
Index ¶
- Variables
- type BTTVEmoteFetcher
- type Cache
- func (s *Cache) AddUserEmotes(userID string, emotes []Emote)
- func (s *Cache) AllEmotesUsableByUser(userID string) []Emote
- func (s *Cache) GetAll() EmoteSet
- func (s *Cache) GetAllForChannel(id string) EmoteSet
- func (s *Cache) GetByText(channelID, text string) (Emote, bool)
- func (s *Cache) GetByTextAllChannels(text string) (Emote, bool)
- func (s *Cache) LoadSetForeignEmote(emoteID, emoteText string) Emote
- func (s *Cache) RefreshGlobal(ctx context.Context) error
- func (s *Cache) RefreshLocal(ctx context.Context, channelID string) error
- func (s *Cache) RemoveEmoteSetForChannel(channelID string)
- type DisplayManager
- type Emote
- type EmoteSet
- type EmoteStore
- type FFZEmoteFetcher
- type Platform
- type Replacer
- type SevenTVEmoteFetcher
- type TwitchEmoteFetcher
Constants ¶
This section is empty.
Variables ¶
var ErrPartialFetch = errors.New("emote data could only be partially fetched")
Functions ¶
This section is empty.
Types ¶
type BTTVEmoteFetcher ¶ added in v0.0.3
type Cache ¶ added in v0.6.2
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶ added in v0.6.2
func NewCache(logger zerolog.Logger, twitchEmotes TwitchEmoteFetcher, sevenTVEmotes SevenTVEmoteFetcher, bttvEmotes BTTVEmoteFetcher, ffzEmotes FFZEmoteFetcher) *Cache
func (*Cache) AddUserEmotes ¶ added in v0.6.2
func (*Cache) AllEmotesUsableByUser ¶ added in v0.6.2
func (*Cache) GetAllForChannel ¶ added in v0.6.2
GetAllForChannel retrieves all emotes for a specific user.
func (*Cache) GetByTextAllChannels ¶ added in v0.6.2
func (*Cache) LoadSetForeignEmote ¶ added in v0.6.2
func (*Cache) RefreshGlobal ¶ added in v0.6.2
func (*Cache) RefreshLocal ¶ added in v0.6.2
RefreshLocal refreshes the local emote cache for a specific channel. A failing or slow 3rd party API costs only its own emotes: the rest is cached and an ErrPartialFetch is returned. Nothing is cached when the refresh as a whole ran out of time before any provider answered.
func (*Cache) RemoveEmoteSetForChannel ¶ added in v0.6.2
type DisplayManager ¶ added in v0.6.2
type DisplayManager interface {
Convert(unit kittyimg.DisplayUnit) (kittyimg.KittyDisplayUnit, error)
}
type EmoteStore ¶ added in v0.4.0
type FFZEmoteFetcher ¶ added in v0.9.0
type Replacer ¶ added in v0.4.0
type Replacer struct {
// contains filtered or unexported fields
}
func NewReplacer ¶ added in v0.4.0
func NewReplacer(httpClient *http.Client, store EmoteStore, enableGraphics bool, theme save.Theme, displayManager DisplayManager) *Replacer
func (*Replacer) Replace ¶ added in v0.4.0
func (i *Replacer) Replace(ctx context.Context, channelID, content string, emoteList []twitchirc.Emote) (string, map[string]string, error)
Replace enriches emote tokens, using ctx for every image download. Cancellation returns any replacements already prepared along with the context error.