Versions in this module Expand all Collapse all v1 v1.0.0 Dec 7, 2022 Changes in this version + const AttachmentLifetime + const AttachmentPruneThreshold + var ErrGetFailed = errors.New("cache: attachment download: http error") + var ErrIO = errors.New("cache: attachment download: I/O error") + var ErrMissing = errors.New("cache: entry not present") + var ErrNilProvider = errors.New("cache: attempted to create cache with nil provider") + var ErrRequest = errors.New("cache: attachment download: network request failed") + type Attachment struct + Content []byte + LastReference time.Time + Name string + Type string + type Cache struct + func NewCache(p Provider) *Cache + func (c *Cache) Attachment(at *discordgo.MessageAttachment) (Attachment, error) + func (c *Cache) Channel(ID string) (discordgo.Channel, error) + func (c *Cache) Clean() + func (c *Cache) Guild(ID string) (discordgo.Guild, error) + func (c *Cache) InvalidateChannel(ID string) error + func (c *Cache) InvalidateGuild(ID string) error + func (c *Cache) InvalidateUser(ID string) error + func (c *Cache) User(ID string) (discordgo.User, error) + type Provider interface + Channel func(channelID string) (c *discordgo.Channel, err error) + Guild func(guildID string) (st *discordgo.Guild, err error) + User func(userID string) (u *discordgo.User, err error)