Documentation ¶
Index ¶
- func DownloadEmote(emote Emote, size ImageSize) ([]byte, error)
- func DownloadEmoteHalves(emote Emote, size ImageSize) ([]byte, []byte, error)
- func FormatBTTVEmote(id string, size ImageSize) string
- func FormatFFZEmote(id string, size ImageSize) string
- func InitIdealGifFrames(path string)
- func ShouldNotCache(emote Emote) bool
- type BttvChannelResponse
- type BttvEmote
- type BttvProvider
- type Emote
- type EmoteStore
- func (s *EmoteStore) GetChannelEmotes(channelID string) ([]Emote, bool)
- func (s *EmoteStore) GetEmote(identifierCode rune, emoteID string) (Emote, bool)
- func (s *EmoteStore) GetEmoteFromWord(word, channelID string) (Emote, bool)
- func (s *EmoteStore) Init() error
- func (s *EmoteStore) Load(channelID string) error
- func (s *EmoteStore) LoadIfNotLoaded(channelID string) error
- func (s *EmoteStore) ProviderFromCode(identifierCode rune) (Provider, bool)
- type FfzEmote
- type FfzEmoteContainer
- type FfzGlobal
- type FfzProvider
- type FfzRoom
- type FfzRoomInfo
- type FfzSet
- type FfzUrls
- type ImageFileCache
- func (c *ImageFileCache) AutoEvict(ctx context.Context)
- func (c *ImageFileCache) DownloadToCache(emote Emote, size ImageSize) error
- func (c *ImageFileCache) DownloadVirtualToCache(emote Emote, size ImageSize) error
- func (c *ImageFileCache) Evict() (int, error)
- func (c *ImageFileCache) GetCachedOrDownload(emote Emote, size ImageSize, writer io.Writer) error
- func (c *ImageFileCache) GetCachedOrDownloadHalf(emote Emote, size ImageSize, half VirtualHalf, writer io.Writer) error
- func (c *ImageFileCache) GetEmoteAspectRatio(emote Emote) (float64, error)
- func (c *ImageFileCache) Index() error
- func (c *ImageFileCache) Purge() error
- type ImageSize
- type Provider
- type ProviderEmotes
- type SevenTVEmote
- type SevenTVProvider
- type VirtualHalf
- type WordMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadEmoteHalves ¶
func FormatBTTVEmote ¶
func FormatFFZEmote ¶
func InitIdealGifFrames ¶
func InitIdealGifFrames(path string)
func ShouldNotCache ¶ added in v1.2.0
Types ¶
type BttvChannelResponse ¶
type BttvChannelResponse struct { ChanEmotes []*BttvEmote `json:"channelEmotes"` }
type BttvEmote ¶
type BttvEmote struct { ID string `json:"id"` Code string `json:"code"` ImageType string `json:"imageType"` }
func GetChannelBTTVEmotes ¶
func GetGlobalBTTVEmotes ¶
func GetSpecificBTTVEmote ¶
func (*BttvEmote) LetterCode ¶
type BttvProvider ¶ added in v1.2.0
type BttvProvider struct{}
func (BttvProvider) IdentifierCode ¶ added in v1.2.0
func (b BttvProvider) IdentifierCode() rune
func (BttvProvider) LoadChannelEmotes ¶ added in v1.2.0
func (b BttvProvider) LoadChannelEmotes(channelID string) ([]Emote, error)
func (BttvProvider) LoadGlobalEmotes ¶ added in v1.2.0
func (b BttvProvider) LoadGlobalEmotes() ([]Emote, error)
func (BttvProvider) LoadSpecificEmote ¶ added in v1.2.0
func (b BttvProvider) LoadSpecificEmote(emoteID string) (Emote, error)
type Emote ¶
type Emote interface { // EmoteID is an identifier string for the emote within its provider's realm. EmoteID() string // TypedName is the name that people type into Twitch chat. TypedName() string // URL returns the URL to render the emote for the given size. URL(size ImageSize) string // LetterCode returns the provider prefix letter code. LetterCode() string // Type returns the emote type/mimetype of the image. Type() string }
type EmoteStore ¶
type EmoteStore struct {
// contains filtered or unexported fields
}
func NewEmoteStore ¶
func NewEmoteStore() *EmoteStore
func (*EmoteStore) GetChannelEmotes ¶
func (s *EmoteStore) GetChannelEmotes(channelID string) ([]Emote, bool)
func (*EmoteStore) GetEmote ¶ added in v1.2.0
func (s *EmoteStore) GetEmote(identifierCode rune, emoteID string) (Emote, bool)
func (*EmoteStore) GetEmoteFromWord ¶
func (s *EmoteStore) GetEmoteFromWord(word, channelID string) (Emote, bool)
func (*EmoteStore) Init ¶
func (s *EmoteStore) Init() error
func (*EmoteStore) Load ¶
func (s *EmoteStore) Load(channelID string) error
func (*EmoteStore) LoadIfNotLoaded ¶
func (s *EmoteStore) LoadIfNotLoaded(channelID string) error
LoadIfNotLoaded loads and caches BTTV and FFZ emotes for a channel
func (*EmoteStore) ProviderFromCode ¶ added in v1.2.0
func (s *EmoteStore) ProviderFromCode(identifierCode rune) (Provider, bool)
type FfzEmote ¶
func GetChannelFFZEmotes ¶
func GetGlobalFFZEmotes ¶
func GetSpecificFFZEmote ¶
func (*FfzEmote) LetterCode ¶
type FfzEmoteContainer ¶
type FfzEmoteContainer struct {
Emote FfzEmote `json:"emote"`
}
type FfzProvider ¶ added in v1.2.0
type FfzProvider struct{}
func (FfzProvider) IdentifierCode ¶ added in v1.2.0
func (f FfzProvider) IdentifierCode() rune
func (FfzProvider) LoadChannelEmotes ¶ added in v1.2.0
func (f FfzProvider) LoadChannelEmotes(channelID string) ([]Emote, error)
func (FfzProvider) LoadGlobalEmotes ¶ added in v1.2.0
func (f FfzProvider) LoadGlobalEmotes() ([]Emote, error)
func (FfzProvider) LoadSpecificEmote ¶ added in v1.2.0
func (f FfzProvider) LoadSpecificEmote(emoteID string) (Emote, error)
type FfzRoom ¶
type FfzRoom struct { RoomInfo FfzRoomInfo `json:"room"` Sets map[string]*FfzSet `json:"sets"` }
type FfzRoomInfo ¶
type FfzRoomInfo struct {
Set int `json:"set"`
}
type ImageFileCache ¶
type ImageFileCache struct {
// contains filtered or unexported fields
}
func NewImageFileCache ¶
func NewImageFileCache(basePath string, expiration time.Duration, cleanOnIndex bool) *ImageFileCache
func (*ImageFileCache) AutoEvict ¶
func (c *ImageFileCache) AutoEvict(ctx context.Context)
func (*ImageFileCache) DownloadToCache ¶
func (c *ImageFileCache) DownloadToCache(emote Emote, size ImageSize) error
func (*ImageFileCache) DownloadVirtualToCache ¶
func (c *ImageFileCache) DownloadVirtualToCache(emote Emote, size ImageSize) error
func (*ImageFileCache) Evict ¶
func (c *ImageFileCache) Evict() (int, error)
func (*ImageFileCache) GetCachedOrDownload ¶
func (*ImageFileCache) GetCachedOrDownloadHalf ¶
func (c *ImageFileCache) GetCachedOrDownloadHalf(emote Emote, size ImageSize, half VirtualHalf, writer io.Writer) error
func (*ImageFileCache) GetEmoteAspectRatio ¶
func (c *ImageFileCache) GetEmoteAspectRatio(emote Emote) (float64, error)
func (*ImageFileCache) Index ¶
func (c *ImageFileCache) Index() error
func (*ImageFileCache) Purge ¶
func (c *ImageFileCache) Purge() error
type ImageSize ¶
type ImageSize int
func (ImageSize) BttvString ¶
func (ImageSize) SevenTVString ¶ added in v1.2.0
type ProviderEmotes ¶ added in v1.2.0
type SevenTVEmote ¶ added in v1.2.0
type SevenTVEmote struct { ID string `json:"id"` Name string `json:"name"` MimeType string `json:"mime"` URLs [][2]string `json:"urls"` Widths []int `json:"width"` Heights []int `json:"height"` }
func GetChannelSevenTVEmotes ¶ added in v1.2.0
func GetChannelSevenTVEmotes(channelID string) ([]*SevenTVEmote, error)
func GetGlobalSevenTVEmotes ¶ added in v1.2.0
func GetGlobalSevenTVEmotes() ([]*SevenTVEmote, error)
func GetSpecificSevenTVEmote ¶ added in v1.2.0
func GetSpecificSevenTVEmote(emoteID string) (*SevenTVEmote, error)
func (*SevenTVEmote) EmoteID ¶ added in v1.2.0
func (s *SevenTVEmote) EmoteID() string
func (*SevenTVEmote) LetterCode ¶ added in v1.2.0
func (s *SevenTVEmote) LetterCode() string
func (*SevenTVEmote) Type ¶ added in v1.2.0
func (s *SevenTVEmote) Type() string
func (*SevenTVEmote) TypedName ¶ added in v1.2.0
func (s *SevenTVEmote) TypedName() string
func (*SevenTVEmote) URL ¶ added in v1.2.0
func (s *SevenTVEmote) URL(size ImageSize) string
type SevenTVProvider ¶ added in v1.2.0
type SevenTVProvider struct{}
func (SevenTVProvider) IdentifierCode ¶ added in v1.2.0
func (s SevenTVProvider) IdentifierCode() rune
func (SevenTVProvider) LoadChannelEmotes ¶ added in v1.2.0
func (s SevenTVProvider) LoadChannelEmotes(channelID string) ([]Emote, error)
func (SevenTVProvider) LoadGlobalEmotes ¶ added in v1.2.0
func (s SevenTVProvider) LoadGlobalEmotes() ([]Emote, error)
func (SevenTVProvider) LoadSpecificEmote ¶ added in v1.2.0
func (s SevenTVProvider) LoadSpecificEmote(emoteID string) (Emote, error)
type VirtualHalf ¶
type VirtualHalf int
const ( LeftHalf VirtualHalf = iota RightHalf )
func (VirtualHalf) LetterCode ¶
func (h VirtualHalf) LetterCode() string
Click to show internal directories.
Click to hide internal directories.