Documentation
¶
Overview ¶
Package convert implements conversions to different Slackdump formats. It is a layer on top of the transformer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyChunk = errors.New("missing chunk") ErrNoLocFunction = errors.New("missing location function") )
Functions ¶
This section is empty.
Types ¶
type DumpConverter ¶ added in v3.1.0
type DumpConverter struct {
// contains filtered or unexported fields
}
func NewToDump ¶ added in v3.1.0
func NewToDump(src source.Sourcer, trg fsadapter.FS, opts ...DumpOption) *DumpConverter
NewToDump creates a new dump converter.
type DumpOption ¶ added in v3.1.0
type DumpOption func(*DumpConverter)
func DumpWithIncludeFiles ¶ added in v3.1.0
func DumpWithIncludeFiles(b bool) DumpOption
func DumpWithLogger ¶ added in v3.1.0
func DumpWithLogger(log *slog.Logger) DumpOption
type FileCopier ¶ added in v3.1.0
type FileCopier struct {
// contains filtered or unexported fields
}
func NewFileCopier ¶ added in v3.1.0
func (*FileCopier) Copy ¶ added in v3.1.0
Copy iterates through the files in the message and copies them to the target directory. Source file location is determined by calling the srcFileLoc function, joined with the chunk directory name. target file location — by calling trgFileLoc function, and is relative to the target fsadapter root.
type Option ¶ added in v3.1.0
type Option func(*options)
func WithIgnoreCopyErrors ¶ added in v3.1.1
func WithIncludeAvatars ¶ added in v3.0.4
WithIncludeAvatars sets the IncludeAvatars option.
func WithIncludeFiles ¶
WithIncludeFiles sets the IncludeFiles option.
type SourceEncoder ¶ added in v3.1.0
type SourceEncoder struct {
// contains filtered or unexported fields
}
SourceEncoder allows to convert any source to a chunked format.
func NewSourceEncoder ¶ added in v3.1.0
type Target ¶ added in v3.1.0
type Target interface {
// Convert should convert the data for the single channel and save it to
// the target format.
transform.Converter
// Users should convert and write users.
Users(ctx context.Context, uu []slack.User) error
// Channels should converts and write channels.
Channels(ctx context.Context, uu []slack.Channel) error
// WorkspaceInfo writes workspace info.
WorkspaceInfo(ctx context.Context, wi *slack.AuthTestResponse) error
}
Target is the interface for writing the target format.
type ToExport ¶ added in v3.1.0
type ToExport struct {
// contains filtered or unexported fields
}
ToExport is a converter between Chunk and Export formats. Zero value is not usable.
func NewToExport ¶ added in v3.1.0
NewToExport returns the converter from any source to export format. src is the Source to be converted (e.g. chunk or database), trgfs is the target FS adapter where files and data will be written. By default, the converter does not include files and avatars. The default storage format for both source and destination is Mattermost, use functional options to configure this behaviour.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_convert is a generated GoMock package.
|
Package mock_convert is a generated GoMock package. |
|
fileproc
Package fileproc is the file processor that can be used in conjunction with the transformer.
|
Package fileproc is the file processor that can be used in conjunction with the transformer. |