webserver

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, controllers Controllers) *fiber.App

New builds a new Fiber application and set up the required routes

Types

type Config

type Config struct {
	Version           string
	SessionTimeout    time.Duration
	MinPasswordLength int
	WordsPerMinute    float64
	JwtSecret         []byte
	Hostname          string
	Port              int
	HomeDir           string
	LibraryPath       string
	CoverMaxWidth     int
	RequireAuth       bool
}

type Controllers added in v3.1.1

type Controllers struct {
	Auth                                  *controller.Auth
	Users                                 *controller.Users
	Cover                                 func(c *fiber.Ctx) error
	Send                                  func(c *fiber.Ctx) error
	Download                              func(c *fiber.Ctx) error
	Read                                  func(c *fiber.Ctx) error
	Search                                func(c *fiber.Ctx) error
	AllowIfNotLoggedInMiddleware          func(c *fiber.Ctx) error
	AlwaysRequireAuthenticationMiddleware func(c *fiber.Ctx) error
	ConfigurableAuthenticationMiddleware  func(c *fiber.Ctx) error
	ErrorHandler                          func(c *fiber.Ctx, err error) error
}

func SetupControllers added in v3.1.1

func SetupControllers(cfg Config, db *gorm.DB, metadataReaders map[string]metadata.Reader, idx *index.BleveIndexer, sender Sender) Controllers

type Sender

type Sender interface {
	Send(address, subject, body string) error
	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