Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("channel not found")
Functions ¶
This section is empty.
Types ¶
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
func NewInMemoryStorage ¶
func NewInMemoryStorage(expredDuration time.Duration) *InMemoryStorage
NewInMemoryStorage creates a new in-memory storage. if expredDuration is 0, it never expires.
func (*InMemoryStorage) GetByChannelName ¶
func (*InMemoryStorage) NeedRefresh ¶
func (s *InMemoryStorage) NeedRefresh(ctx context.Context) bool
func (*InMemoryStorage) SetChannels ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func New ¶
func New(client SlackClient, optFns ...ResolverOption) *Resolver
New creates a new resolver with the provided slack client and options.
type ResolverOption ¶
type ResolverOption func(*resolverOptions)
func WithBatchSize ¶
func WithBatchSize(size int) ResolverOption
WithBatchSize sets the batch size for users.conversations API and conversations.list API limit parameter. default is 1000.
func WithCacheStorage ¶
func WithCacheStorage(storage Storage) ResolverOption
WithCacheStorage sets the cache storage for the resolver. default is in-memory storage.
func WithExcludeArchived ¶
func WithExcludeArchived() ResolverOption
WithExcludeArchived excludes archived channels from the search result.
func WithRefreshOnCacheMiss ¶
func WithRefreshOnCacheMiss() ResolverOption
WithRefreshOnCacheMiss refreshes the cache storage when a channel is not found in the cache.
func WithSearchPublicChannels ¶
func WithSearchPublicChannels() ResolverOption
WithSearchPublicChannels enables searching public channels. with conversations.list API.
type SlackClient ¶
type SlackClient interface {
GetConversationsForUserContext(ctx context.Context, params *slack.GetConversationsForUserParameters) (channels []slack.Channel, nextCursor string, err error)
GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) (channels []slack.Channel, nextCursor string, err error)
}
Click to show internal directories.
Click to hide internal directories.