document

package
v4.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: GPL-3.0 Imports: 29 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
	HomeDir               string
	CoverMaxWidth         int
	Hostname              string
	Port                  int
	UploadDocumentMaxSize int
	ClientImageCacheTTL   int
	ServerImageCacheTTL   int
	ShareCommentMaxSize   int
	ShareMaxRecipients    int
}

type Controller

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

func NewController

func NewController(hlRepository highlightsRepository, usersRepository usersRepository, readingRepository readingRepository, sender Sender, idx IdxReaderWriter, metadataReaders map[string]metadata.Reader, appFs afero.Fs, cfg Config, translator i18n.Translator) *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) GetPosition added in v4.14.0

func (d *Controller) GetPosition(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) Share added in v4.19.0

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

func (*Controller) Subjects added in v4.18.0

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

Subjects returns all subjects from the index grouped by slug (map[slug][]names), as JSON

func (*Controller) UpdatePosition added in v4.14.0

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

func (*Controller) Upload

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

func (*Controller) UploadForm

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

type IdxReaderWriter

type IdxReaderWriter interface {
	Search(searchFields index.SearchFields, page, resultsPerPage int) (result.Paginated[[]index.Document], error)
	Count() (uint64, error)
	Close() error
	Document(Slug string) (index.Document, error)
	File(slug string) (*index.IndexedFile, error)
	Cover(slug string, coverMaxWidth int) ([]byte, 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)
	NewFile(fileName string, contents []byte) (string, error)
	DeleteDocument(slug string) error
	Documents(slugs []string) (map[string]index.Document, error)
	Languages() ([]string, error)
	Subjects() (map[string][]string, error)
}

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

type Sender

type Sender interface {
	SendBCC(addresses []string, subject, body string) error
	SendDocument(address, subject string, file []byte, fileName string) error
	From() string
}

Jump to

Keyboard shortcuts

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