ereader

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKeyFromContext

func GetAPIKeyFromContext(ctx context.Context) *apikeys.APIKey

GetAPIKeyFromContext retrieves the API key from context.

func RegisterRoutes

func RegisterRoutes(e *echo.Echo, db *bun.DB, downloadCache *downloadcache.Cache)

RegisterRoutes registers all eReader routes.

func RenderPage

func RenderPage(content string) string

RenderPage wraps content in the base template.

func ResolveShortURL

func ResolveShortURL(c echo.Context, apiKeyService *apikeys.Service) error

ResolveShortURL redirects a short code to the full eReader URL.

Types

type Middleware

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

Middleware provides authentication middleware for eReader routes.

func NewMiddleware

func NewMiddleware(apiKeyService *apikeys.Service) *Middleware

NewMiddleware creates a new eReader middleware.

func (*Middleware) APIKeyAuth

func (m *Middleware) APIKeyAuth(requiredPermission string) echo.MiddlewareFunc

APIKeyAuth validates the API key from the URL path and checks for required permission.

Jump to

Keyboard shortcuts

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