viewer

package
v3.0.0-...-fed599b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package viewer implements the logic to view the slackdump files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sourcer

type Sourcer interface {
	// Name should return the name of the retriever underlying media, i.e.
	// directory or archive.
	Name() string
	// Type should return the type of the retriever, i.e. "chunk" or "export".
	Type() string
	// Channels should return all channels.
	Channels() ([]slack.Channel, error)
	// Users should return all users.
	Users() ([]slack.User, error)
	// AllMessages should return all messages for the given channel id.
	AllMessages(channelID string) ([]slack.Message, error)
	// AllThreadMessages should return all messages for the given tuple
	// (channelID, threadID).
	AllThreadMessages(channelID, threadID string) ([]slack.Message, error)
	// ChannelInfo should return the channel information for the given channel
	// id.
	ChannelInfo(channelID string) (*slack.Channel, error)
	// FS should return the filesystem with file attachments.
	FS() fs.FS
	// File should return the path of the file within the filesystem returned
	// by FS().
	File(fileID string, filename string) (string, error)
}

Sourcer is an interface for retrieving data from different sources.

type Viewer

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

Viewer is the slackdump viewer.

func New

func New(ctx context.Context, addr string, r Sourcer) (*Viewer, error)

New creates new viewer instance. Once Viewer.ListenAndServe is called, the viewer will start serving the web interface on the given address. The address should be in the form of ":8080". The viewer will use the given Sourcer to retrieve the data, see "source" package for available options. It will initialise the logger from the context.

func (*Viewer) Close

func (v *Viewer) Close() error

func (*Viewer) ListenAndServe

func (v *Viewer) ListenAndServe() error

Directories

Path Synopsis
functions
Package functions provides shared template functions.
Package functions provides shared template functions.

Jump to

Keyboard shortcuts

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