dl

package
v2.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	// ProcessFunc returns the process function that should be passed to
	// DumpMessagesRaw. It should be able to extract files from the messages
	// and download them.  If the downloader is not started, i.e. if file
	// download is disabled, it should silently ignore the error and return
	// nil.
	ProcessFunc(channelName string) slackdump.ProcessFunc
	StartStopper
}

Exporter is the file exporter interface.

type Mattermost

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

func NewMattermost

func NewMattermost(fs fsadapter.FS, cl *slack.Client, l logger.Interface, token string) *Mattermost

NewMattermost returns the dl, that downloads the files into the __uploads directory, so that it could be transformed into bulk import by mmetl and imported into mattermost with mmctl import bulk.

func (*Mattermost) ProcessFunc

func (md *Mattermost) ProcessFunc(_ string) slackdump.ProcessFunc

ProcessFunc returns the ProcessFunc that downloads the files into the __uploads directory in the root of the download filesystem.

func (*Mattermost) Start

func (bd *Mattermost) Start(ctx context.Context)

func (*Mattermost) Stop

func (bd *Mattermost) Stop()

type Nothing

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

Nothing does not download any files, it just updates the link adding a token query parameter, if the token is set.

func NewFileUpdater

func NewFileUpdater(token string) Nothing

NewFileUpdater returns an fileExporter that does not download any files, but updates the link adding a token query parameter, if the token is set.

func (Nothing) ProcessFunc

func (u Nothing) ProcessFunc(_ string) slackdump.ProcessFunc

ProcessFunc returns the slackdump.ProcessFunc that updates the file link adding a token query parameter.

func (Nothing) Start

func (Nothing) Start(context.Context)

Start does nothing.

func (Nothing) Stop

func (Nothing) Stop()

Stop does nothing.

type StartStopper

type StartStopper interface {
	Start(ctx context.Context)
	Stop()
}

type Std

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

func NewStd

func NewStd(fs fsadapter.FS, cl *slack.Client, l logger.Interface, token string) *Std

NewStd returns standard dl, which downloads files into "channel_id/attachments" directory.

func (*Std) ProcessFunc

func (d *Std) ProcessFunc(channelName string) slackdump.ProcessFunc

ProcessFunc returns the function that downloads the file into channel_id/attachments directory. If Slack token is set, it updates the thumbnails to include that token. It replaces the file URL to point to physical downloaded files on disk.

func (*Std) Start

func (bd *Std) Start(ctx context.Context)

func (*Std) Stop

func (bd *Std) Stop()

Jump to

Keyboard shortcuts

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