handlers

package
v0.0.0-...-d3e7db7 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(
	c *fiber.Ctx,
	component templ.Component,
	options ...func(*templ.ComponentHandler),
) error

Render creates the render of the functional template (go file) that we are passing to it

func SetRoutes

func SetRoutes(
	app *fiber.App, ah AuthHandler, sh SettingsHandler, sch SearchHandler,
)

SetRoutes sets the routes in the application and associates them with their respective handlers

Types

type AuthHandler

type AuthHandler struct {
	UserServices AuthService
}

func NewAuthHandler

func NewAuthHandler(us AuthService) AuthHandler

type AuthService

type AuthService interface {
	CreateAdmin(ad services.User) error
	LoginAsAdmin(email, password string) (services.User, error)
}

type SearchHandler

type SearchHandler struct {
	Search SearchService
}

func NewSearchHandler

func NewSearchHandler(s SearchService) SearchHandler

type SearchService

type SearchService interface {
	SearchFullText(v string) ([]services.CrawledUrl, error)
}

type SettingsHandler

type SettingsHandler struct {
	SearchConfig SettingsService
}

func NewSettingsHandler

func NewSettingsHandler(ss SettingsService) SettingsHandler

type SettingsService

type SettingsService interface {
	Get() (services.SearchSettings, error)
	Upadate(amount uint, searchOn, addNew bool) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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