preferences

package
v0.0.1-0...-104a2d1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHTTPHandlers

func RegisterHTTPHandlers(db *pgxpool.Pool, validate *validation.Validator, tkn *jwt.Service, logger *zerolog.Logger) http.Handler

Types

type Handler

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

func NewHandler

func NewHandler(validator *validation.Validator, repo Repository, logger *zerolog.Logger) *Handler

func (*Handler) GetPreferences

func (h *Handler) GetPreferences(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdatePreferences

func (h *Handler) UpdatePreferences(w http.ResponseWriter, r *http.Request)

type Repository

type Repository interface {
	// GetPreferencesByUserId retrieves preferences for a specific user
	GetPreferencesByUserId(ctx context.Context, userID uuid.UUID) (repository.GetPreferencesByUserIdRow, error)
	// UpdatePreferences updates a user's preferences
	UpdatePreferences(ctx context.Context, params repository.UpdatePreferencesParams) (repository.Preference, error)
}

Repository defines the interface for user preferences data operations

func NewRepository

func NewRepository(queries *repository.Queries) Repository

NewRepository creates a new preferences repository

type UpdateUserPreferencesReq

type UpdateUserPreferencesReq struct {
	Currency          *string `json:"currency"`
	Locale            *string `json:"locale"`
	Theme             *string `json:"theme"`
	Timezone          *string `json:"timezone"`
	TimeFormat        *string `json:"time_format"`
	DateFormat        *string `json:"date_format"`
	StartWeekOnMonday *bool   `json:"start_week_on_monday"`
	DarkSidebar       *bool   `json:"dark_sidebar"`
}

UserPreferences holds the user preferences data structure

Jump to

Keyboard shortcuts

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