Documentation ¶
Overview ¶
Package dirproc is a processor that writes the data into gzipped files in a directory. Each conversation is output to a separate gzipped JSONL file. If a thread is given, the filename will have the thread ID in it.
Index ¶
- type Channels
- type ConvOption
- type Conversations
- func (cv *Conversations) ChannelInfo(ctx context.Context, ci *slack.Channel, threadTS string) error
- func (cv *Conversations) ChannelUsers(ctx context.Context, channelID string, threadTS string, cu []string) error
- func (cv *Conversations) Close() error
- func (cv *Conversations) Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ...) error
- func (cv *Conversations) Messages(ctx context.Context, channelID string, numThreads int, isLast bool, ...) error
- func (cv *Conversations) ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly bool, ...) error
- type Search
- type Transformer
- type UserOption
- type Users
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channels ¶
type Channels struct {
// contains filtered or unexported fields
}
Channels is a processor that writes the channel information into the channels file.
func NewChannels ¶
NewChannels creates a new Channels processor. fn is called for each channel chunk that is retrieved. The function is called before the chunk is processed by the recorder.
type ConvOption ¶
type ConvOption func(*Conversations)
ConvOption is a function that configures the Conversations processor.
func WithLogger ¶
func WithLogger(lg *slog.Logger) ConvOption
WithLogger sets the logger for the processor.
func WithRecordFiles ¶
func WithRecordFiles(b bool) ConvOption
WithRecordFiles sets whether the files should be recorded in the chunk file.
type Conversations ¶
type Conversations struct {
// contains filtered or unexported fields
}
Conversations is a processor that writes the channel and thread messages. Zero value is unusable. Use NewConversation to create a new instance.
func NewConversation ¶
func NewConversation(cd *chunk.Directory, filesSubproc processor.Filer, tf Transformer, opts ...ConvOption) (*Conversations, error)
NewConversation returns the new conversation processor. filesSubproc will be called for each file chunk, tf will be called for each completed channel or thread, when the reference count becomes zero. Reference count is increased with each call to Channel processing functions.
func (*Conversations) ChannelInfo ¶
ChannelInfo is called for each channel that is retrieved.
func (*Conversations) ChannelUsers ¶
func (*Conversations) Close ¶
func (cv *Conversations) Close() error
func (*Conversations) Files ¶
func (cv *Conversations) Files(ctx context.Context, channel *slack.Channel, parent slack.Message, ff []slack.File) error
Files is called for each file that is retrieved. The parent message is passed in as well.
func (*Conversations) Messages ¶
func (cv *Conversations) Messages(ctx context.Context, channelID string, numThreads int, isLast bool, mm []slack.Message) error
Messages is called for each message slice that is retrieved.
func (*Conversations) ThreadMessages ¶
func (cv *Conversations) ThreadMessages(ctx context.Context, channelID string, parent slack.Message, threadOnly bool, isLast bool, tm []slack.Message) error
ThreadMessages is called for each of the thread messages that are retrieved. The parent message is passed in as well.
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
Search is the search results directory processor. The results are written to "search.json.gz" file in the chunk directory.
type Transformer ¶
type Transformer interface { // Transform is the function that starts the tranformation of the channel // or thread with the given id. It is called when the reference count // for the channel id becomes zero (meaning, that there are no more chunks // to process). It should return [transform.ErrClosed] if the transformer // is closed. Transform(ctx context.Context, id chunk.FileID) error }
Transformer is an interface that is called when the processor is finished processing a channel or thread.
type UserOption ¶
type UserOption func(*Users)
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users is a users processor, writes users into the users.json.gz file.
func NewUsers ¶
func NewUsers(cd *chunk.Directory, opt ...UserOption) (*Users, error)
NewUsers creates a new Users processor.
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
Workspace is a processor that writes the workspace information into the workspace file.
func NewWorkspace ¶
NewWorkspace creates a new workspace processor.