app

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrInvalidInput = errors.New("no valid input")
)

Functions

This section is empty.

Types

type App

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

func New

func New(cfg Config) (*App, error)

New creates a new slackdump app.

func (*App) Run

func (app *App) Run(ctx context.Context) error

type Config

type Config struct {
	Creds     SlackCreds
	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

	Options slackdump.Options
}

func (*Config) Validate

func (p *Config) Validate() error

Validate checks if the command line parameters have valid values.

type Input added in v1.3.0

type Input struct {
	List     []string // Input list
	Filename string   // filename containing the list of Conversation IDs or URLs to download.
}

func (Input) IsValid added in v1.3.0

func (in Input) IsValid() bool

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
}

func (Output) FormatValid

func (out Output) FormatValid() bool

func (Output) IsText

func (out Output) IsText() bool

type SlackCreds

type SlackCreds struct {
	// Token is the Slack auth-token value.
	Token string
	// Cookie may contain cookie value or a filename.  I have mixed feelings
	// about this, but blame cURL, they use the same approach for --cookie, and
	// I have no imagination.  Also, it's simpler from the usability POV, as
	// there's no additional parameter.  Well, I'll repeat this to myself until
	// I start to believe in it.
	Cookie string
}

SlackCreds stores Slack credentials.

func (*SlackCreds) Validate added in v1.3.5

func (c *SlackCreds) Validate() error

type TimeValue added in v1.3.1

type TimeValue time.Time

func (*TimeValue) Set added in v1.3.1

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

func (*TimeValue) String added in v1.3.1

func (tv *TimeValue) String() string

Jump to

Keyboard shortcuts

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