cache

package
v0.0.0-...-5fb48e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel represents a Redis-backed channel cache.

func NewChannel

func NewChannel(rc *redis.Client) *Channel

NewChannel creates a new channel cache.

func (*Channel) Channel

func (c *Channel) Channel(id string) (channel slack.Channel, notFound bool, err error)

Channel finds a channel by its ID in the cache. If the channel is not found, err will be nil and notFound true.

func (*Channel) Lookup

func (c *Channel) Lookup(name string) (slack.Channel, bool, error)

Lookup finds a channel by its name, without the #, in the cache. If the channel is not found, err will be nil and notFound true.

type ChannelFiller

type ChannelFiller struct {
	// contains filtered or unexported fields
}

ChannelFiller is channel cache filler.

func NewChannelFiller

func NewChannelFiller(sc *slack.Client, rc *redis.Client, logger zerolog.Logger) (*ChannelFiller, error)

NewChannelFiller generates a new cache populator.

func (*ChannelFiller) Fill

func (c *ChannelFiller) Fill(ctx context.Context) error

Fill loads the cache.

type InMemChannel

type InMemChannel struct {
	// contains filtered or unexported fields
}

InMemChannel represents a channel info cache.

func NewInMemChannel

func NewInMemChannel(sc *slack.Client, l zerolog.Logger) (*InMemChannel, error)

NewInMemChannel returns a new channel cache.

func (*InMemChannel) Lookup

func (s *InMemChannel) Lookup(name string) (slack.Channel, bool, error)

Lookup finds a channel by name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL