config

package
v2.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputTypeJSON = "json"
	OutputTypeText = "text"
)
View Source
const (
	FilenameTmplName = "fnt"
)

Variables

View Source
var (
	ErrInvalidInput = errors.New("no valid input")
)
View Source
var ErrNothingToDo = errors.New("no valid input and no list flags specified")
View Source
var ErrSkip = errors.New("skip")

ErrSkip is should be returned if the [Producer] should skip the channel.

Functions

This section is empty.

Types

type EmojiParams

type EmojiParams struct {
	Enabled     bool
	FailOnError bool
}

type Input

type Input struct {
	List *structures.EntityList // Include channels
}

func (*Input) IsValid

func (in *Input) IsValid() bool

func (Input) Producer

func (in Input) Producer(fn func(string) error) error

Producer iterates over the list or reads the list from the file and calls fn for each entry.

type ListFlags

type ListFlags struct {
	Users    bool
	Channels bool
}

func (ListFlags) FlagsPresent

func (lf ListFlags) FlagsPresent() bool

type Output

type Output struct {
	Filename string
	Format   string // output format
	Base     string // base directory or zip file
}

func (Output) FormatValid

func (out Output) FormatValid() bool

func (Output) IsText

func (out Output) IsText() bool

type Params

type Params struct {
	ListFlags ListFlags

	Input  Input  // parameters of the input
	Output Output // " " output

	Oldest TimeValue // oldest time to dump conversations from
	Latest TimeValue // latest time to dump conversations to

	FilenameTemplate string

	ExportName  string            // export file or directory name.
	ExportType  export.ExportType // export type, see enum for available options.
	ExportToken string            // token that will be added to all exported files.

	Emoji EmojiParams

	Options slackdump.Options
}

Params is the application config parameters.

func (*Params) CompileTemplates

func (p *Params) CompileTemplates() (*template.Template, error)

func (*Params) Logger

func (p *Params) Logger() logger.Interface

func (*Params) Validate

func (p *Params) Validate() error

Validate checks if the command line parameters have valid values.

type TimeValue

type TimeValue time.Time

TimeValue satisfies flag.Value, used for command line parsing.

func (*TimeValue) Set

func (tv *TimeValue) Set(s string) error

func (*TimeValue) String

func (tv *TimeValue) String() string

Jump to

Keyboard shortcuts

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