processor

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avatars

type Avatars interface {
	Users
	io.Closer
}

Avatars is the interface for downloading avatars.

type ChannelInformer

type ChannelInformer interface {
	// ChannelInfo is called for each channel that is retrieved.  ChannelInfo
	// will be called for each direct thread link, and in this case, threadID
	// will be set to the parent message's timestamp.
	ChannelInfo(ctx context.Context, ci *slack.Channel, threadID string) error
	ChannelUsers(ctx context.Context, channelID string, threadTS string, users []string) error
}

type Channels

type Channels interface {
	// Channels is called for each channel chunk that is retrieved.
	Channels(ctx context.Context, channels []slack.Channel) error
}

type Conversations

type Conversations interface {
	Messenger
	Filer
	ChannelInformer

	io.Closer
}

Conversations is the interface for conversation fetching with files.

func AppendChannelInformer

func AppendChannelInformer(c Conversations, ci ...ChannelInformer) Conversations

PrependChannelInformer prepends the ChannelInformer to the Conversations.

func AppendFiler

func AppendFiler(c Conversations, ff ...Filer) Conversations

PrependFiler prepends the Filer to the Conversations.

func AppendMessenger

func AppendMessenger(c Conversations, mm ...Messenger) Conversations

PrependMessenger prepends the Messenger to the Conversations.

func PrependChannelInformer

func PrependChannelInformer(c Conversations, ci ...ChannelInformer) Conversations

PrependChannelInformer prepends the ChannelInformer to the Conversations.

func PrependFiler

func PrependFiler(c Conversations, ff ...Filer) Conversations

PrependFiler prepends the Filer to the Conversations.

func PrependMessenger

func PrependMessenger(c Conversations, mm ...Messenger) Conversations

PrependMessenger prepends the Messenger to the Conversations.

type FileSearcher

type FileSearcher interface {
	// SearchFiles is called for each of the file chunks that are retrieved.
	SearchFiles(ctx context.Context, query string, files []slack.File) error
	// Filer is embedded here to allow for the Files method to be called.
	Filer
}

FileSearcher is the interface for searching files.

type Filer

type Filer interface {
	// Files method is called for each file that is retrieved. The parent message is
	// passed in as well.
	Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ff []slack.File) error
	io.Closer
}

func JoinFilers

func JoinFilers(procs ...Filer) Filer

JoinFilers joins multiple Filer processors into one.

type JointChannels

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

JointChannels is a processor that joins multiple Channels processors into one.

func JoinChannels

func JoinChannels(procs ...Channels) *JointChannels

JoinChannels joins multiple Channels processors into one. Processors are called in the order they are passed in.

func (*JointChannels) Channels

func (c *JointChannels) Channels(ctx context.Context, ch []slack.Channel) error

func (*JointChannels) Close

func (c *JointChannels) Close() error

type JointConversations

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

JointConversations is a processor that joins multiple processors. TODO: It's done in a crude way, maybe there's a more elegant way to do this.

func (*JointConversations) ChannelInfo

func (w *JointConversations) ChannelInfo(ctx context.Context, ci *slack.Channel, threadID string) error

ChannelInfo executes the prepended ChannelInfo processors and then forwards the call to the Conversations processor.

func (*JointConversations) ChannelUsers

func (w *JointConversations) ChannelUsers(ctx context.Context, channelID string, threadTS string, users []string) error

ChannelUsers executes the prepended ChannelUsers processors and then forwards the call to the Conversations processor.

func (*JointConversations) Close

func (w *JointConversations) Close() error

Close closes all the io.Closer instances in the slice.

func (*JointConversations) Files

func (w *JointConversations) Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ff []slack.File) error

Files executes the prepended Files processors and then forwards the call to the Conversations processor.

func (*JointConversations) Messages

func (w *JointConversations) Messages(ctx context.Context, channelID string, numThreads int, isLast bool, messages []slack.Message) error

Messages executes the prepended Messages processors and then forwards the call to the Conversations processor.

func (*JointConversations) ThreadMessages

func (w *JointConversations) ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly, isLast bool, replies []slack.Message) error

ThreadMessages executes the prepended ThreadMessages processors and then forwards the call to the Conversations processor.

type JointFilers

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

func (*JointFilers) Close

func (f *JointFilers) Close() error

func (*JointFilers) Files

func (f *JointFilers) Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ff []slack.File) error

type JointMessengers

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

func (*JointMessengers) Messages

func (m *JointMessengers) Messages(ctx context.Context, channelID string, numThreads int, isLast bool, messages []slack.Message) error

func (*JointMessengers) ThreadMessages

func (m *JointMessengers) ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly, isLast bool, replies []slack.Message) error

type JointUsers

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

JointUser is a processor that joins multiple Users processors.

func JoinUsers

func JoinUsers(procs ...Users) *JointUsers

JoinUsers joins multiple Users processors into one.

func (*JointUsers) Close

func (u *JointUsers) Close() error

func (*JointUsers) Users

func (u *JointUsers) Users(ctx context.Context, users []slack.User) error

type MessageSearcher

type MessageSearcher interface {
	// SearchMessages is called for each message chunk that is retrieved.
	SearchMessages(ctx context.Context, query string, messages []slack.SearchMessage) error
	ChannelInformer
}

MessageSearcher is the interface for searching messages.

type Messenger

type Messenger interface {
	// Messages method is called for each message that is retrieved.
	Messages(ctx context.Context, channelID string, numThreads int, isLast bool, messages []slack.Message) error
	// ThreadMessages method is called for each of the thread messages that are
	// retrieved. The parent message is passed in as well.
	ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly, isLast bool, replies []slack.Message) error
}

Messenger is the interface that implements only the message fetching.

func JoinMessenger

func JoinMessenger(procs ...Messenger) Messenger

JoinMessenger joins multiple Messenger processors into one.

type NopAvatars

type NopAvatars struct{}

func (*NopAvatars) Close

func (n *NopAvatars) Close() error

func (*NopAvatars) Users

func (n *NopAvatars) Users(ctx context.Context, users []slack.User) error

type NopChannels

type NopChannels struct{}

func (NopChannels) Channels

func (NopChannels) Channels(ctx context.Context, ch []slack.Channel) error

type NopFiler

type NopFiler struct{}

func (*NopFiler) Close

func (n *NopFiler) Close() error

func (*NopFiler) Files

func (n *NopFiler) Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ff []slack.File) error

type Printer

type Printer struct{}

func (*Printer) ChannelInfo

func (d *Printer) ChannelInfo(_ context.Context, ch *slack.Channel, threadID string) error

func (*Printer) ChannelUsers

func (d *Printer) ChannelUsers(_ context.Context, ch string, threadID string, u []string) error

func (*Printer) Close

func (d *Printer) Close() error

func (*Printer) Files

func (d *Printer) Files(_ context.Context, ch *slack.Channel, parent slack.Message, files []slack.File) error

func (*Printer) Messages

func (d *Printer) Messages(ctx context.Context, channelID string, numThreads int, isLast bool, messages []slack.Message) error

func (*Printer) ThreadMessages

func (d *Printer) ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly, isLast bool, replies []slack.Message) error

type Searcher

type Searcher interface {
	MessageSearcher
	FileSearcher
}

Searcher is the combined interface for searching messages and files.

type Users

type Users interface {
	// Users method is called for each user chunk that is retrieved.
	Users(ctx context.Context, users []slack.User) error
}

type WorkspaceInfo

type WorkspaceInfo interface {
	WorkspaceInfo(context.Context, *slack.AuthTestResponse) error
}

Jump to

Keyboard shortcuts

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