settings

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidFitMode

func IsValidFitMode(mode string) bool

IsValidFitMode returns true if the fit mode is valid.

func RegisterRoutes

func RegisterRoutes(e *echo.Echo, db *bun.DB, authMiddleware *auth.Middleware)

func ValidFitModes

func ValidFitModes() []string

ValidFitModes returns all valid fit mode values.

Types

type Service

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

func NewService

func NewService(db *bun.DB) *Service

func (*Service) GetViewerSettings

func (svc *Service) GetViewerSettings(ctx context.Context, userID int) (*models.UserSettings, error)

GetViewerSettings retrieves viewer settings for a user, returning defaults if none exist.

func (*Service) UpdateViewerSettings

func (svc *Service) UpdateViewerSettings(ctx context.Context, userID int, preloadCount int, fitMode string) (*models.UserSettings, error)

UpdateViewerSettings updates viewer settings for a user, creating if not exists.

type ViewerSettingsPayload

type ViewerSettingsPayload struct {
	PreloadCount int    `json:"preload_count"`
	FitMode      string `json:"fit_mode"`
}

ViewerSettingsPayload is the request body for updating viewer settings.

type ViewerSettingsResponse

type ViewerSettingsResponse struct {
	PreloadCount int    `json:"preload_count"`
	FitMode      string `json:"fit_mode"`
}

ViewerSettingsResponse is the response for viewer settings.

Jump to

Keyboard shortcuts

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