document

package
v3.13.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	WordsPerMinute        float64
	LibraryPath           string
	HomeDir               string
	CoverMaxWidth         int
	Hostname              string
	Port                  int
	UploadDocumentMaxSize int
}

type Controller

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

func NewController

func NewController(hlRepository highlightsRepository, sender Sender, idx IdxReaderWriter, metadataReaders map[string]metadata.Reader, appFs afero.Fs, cfg Config) *Controller

func (*Controller) Cover

func (d *Controller) Cover(c *fiber.Ctx) error

func (*Controller) Delete

func (d *Controller) Delete(c *fiber.Ctx) error

func (*Controller) Detail

func (d *Controller) Detail(c *fiber.Ctx) error

func (*Controller) Download

func (d *Controller) Download(c *fiber.Ctx) error

func (*Controller) Reader

func (d *Controller) Reader(c *fiber.Ctx) error

func (*Controller) Search

func (d *Controller) Search(c *fiber.Ctx) error

func (*Controller) Send

func (d *Controller) Send(c *fiber.Ctx) error

func (*Controller) Upload added in v3.11.0

func (d *Controller) Upload(c *fiber.Ctx) error

func (*Controller) UploadForm added in v3.11.0

func (d *Controller) UploadForm(c *fiber.Ctx) error

type IdxReaderWriter

type IdxReaderWriter interface {
	Search(keywords string, page, resultsPerPage int) (result.Paginated[[]index.Document], error)
	Count() (uint64, error)
	Close() error
	Document(Slug string) (index.Document, error)
	SameSubjects(slug string, quantity int) ([]index.Document, error)
	SameAuthors(slug string, quantity int) ([]index.Document, error)
	SameSeries(slug string, quantity int) ([]index.Document, error)
	AddFile(file string) error
	RemoveFile(file string) error
	Documents(IDs []string) (map[string]index.Document, error)
}

IdxReaderWriter defines a set of reading and writing operations over an index

type Sender

type Sender interface {
	SendDocument(address string, libraryPath string, fileName string) error
	From() string
}

Jump to

Keyboard shortcuts

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