Documentation
¶
Index ¶
- func AdminRequired(c *fiber.Ctx) error
- func AuthRequired(c *fiber.Ctx) error
- func BuildAdFromForm(c *fiber.Ctx, userID int, locationID int, adID ...int) (ad.Ad, []*multipart.FileHeader, []int, error)
- func CurrentUser(c *fiber.Ctx) (*user.User, error)
- func GetCurrentUser(c *fiber.Ctx) (*user.User, error)
- func HandleAdCard(c *fiber.Ctx) error
- func HandleAdDetail(c *fiber.Ctx) error
- func HandleAdImage(c *fiber.Ctx) error
- func HandleAdImageSignedURL(c *fiber.Ctx) error
- func HandleAdPage(c *fiber.Ctx) error
- func HandleAdRocks(c *fiber.Ctx) error
- func HandleAdminB2Cache(c *fiber.Ctx) error
- func HandleAdminDashboard(c *fiber.Ctx) error
- func HandleAdminEmbeddingCache(c *fiber.Ctx) error
- func HandleAdminVehicleCache(c *fiber.Ctx) error
- func HandleArchiveAd(c *fiber.Ctx) error
- func HandleBookmarkAd(c *fiber.Ctx) error
- func HandleBookmarksPage(c *fiber.Ctx) error
- func HandleCategories(c *fiber.Ctx) error
- func HandleChangePassword(c *fiber.Ctx) error
- func HandleClearB2Cache(c *fiber.Ctx) error
- func HandleClearQueryEmbeddingCache(c *fiber.Ctx) error
- func HandleClearSiteEmbeddingCache(c *fiber.Ctx) error
- func HandleClearUserEmbeddingCache(c *fiber.Ctx) error
- func HandleClearVehicleCache(c *fiber.Ctx) error
- func HandleCollapseConversation(c *fiber.Ctx) error
- func HandleDeleteAccount(c *fiber.Ctx) error
- func HandleDeleteAd(c *fiber.Ctx) error
- func HandleEditAd(c *fiber.Ctx) error
- func HandleEditAdPartial(c *fiber.Ctx) error
- func HandleEngines(c *fiber.Ctx) error
- func HandleExpandConversation(c *fiber.Ctx) error
- func HandleGridView(c *fiber.Ctx) error
- func HandleHome(c *fiber.Ctx) error
- func HandleListView(c *fiber.Ctx) error
- func HandleLogin(c *fiber.Ctx) error
- func HandleLoginSubmission(c *fiber.Ctx) error
- func HandleLogout(c *fiber.Ctx) error
- func HandleMakes(c *fiber.Ctx) error
- func HandleMapView(c *fiber.Ctx) error
- func HandleMessagesAPI(c *fiber.Ctx) error
- func HandleMessagesPage(c *fiber.Ctx) error
- func HandleModels(c *fiber.Ctx) error
- func HandleNewAd(c *fiber.Ctx) error
- func HandleNewAdSubmission(c *fiber.Ctx) error
- func HandleNotificationMethodChanged(c *fiber.Ctx) error
- func HandlePrivacyPolicy(c *fiber.Ctx) error
- func HandleRefreshB2Cache(c *fiber.Ctx) error
- func HandleRefreshB2Token(c *fiber.Ctx) error
- func HandleRefreshEmbeddingCache(c *fiber.Ctx) error
- func HandleRefreshVehicleCache(c *fiber.Ctx) error
- func HandleRegister(c *fiber.Ctx) error
- func HandleRegisterSubmission(c *fiber.Ctx) error
- func HandleRegistrationStep1(c *fiber.Ctx) error
- func HandleRegistrationStep1Submission(c *fiber.Ctx) error
- func HandleRegistrationStep2Submission(c *fiber.Ctx) error
- func HandleRegistrationVerification(c *fiber.Ctx) error
- func HandleResolveRock(c *fiber.Ctx) error
- func HandleRocksPage(c *fiber.Ctx) error
- func HandleSMSWebhook(c *fiber.Ctx) error
- func HandleSSE(c *fiber.Ctx) error
- func HandleSSEConversationUpdate(c *fiber.Ctx) error
- func HandleSearch(c *fiber.Ctx) error
- func HandleSearchAPI(c *fiber.Ctx) error
- func HandleSearchPage(c *fiber.Ctx) error
- func HandleSendMessage(c *fiber.Ctx) error
- func HandleSettings(c *fiber.Ctx) error
- func HandleSitemap(c *fiber.Ctx) error
- func HandleStartConversation(c *fiber.Ctx) error
- func HandleSubCategories(c *fiber.Ctx) error
- func HandleTermsOfService(c *fiber.Ctx) error
- func HandleThrowRock(c *fiber.Ctx) error
- func HandleTreeCollapseBrowse(c *fiber.Ctx) error
- func HandleTreeCollapseSearch(c *fiber.Ctx) error
- func HandleTreeExpandBrowse(c *fiber.Ctx) error
- func HandleTreeExpandSearch(c *fiber.Ctx) error
- func HandleTreeView(c *fiber.Ctx) error
- func HandleUnbookmarkAd(c *fiber.Ctx) error
- func HandleUpdateAdSubmission(c *fiber.Ctx) error
- func HandleUpdateNotificationMethod(c *fiber.Ctx) error
- func HandleUserMenu(c *fiber.Ctx) error
- func HandleViewRockConversations(c *fiber.Ctx) error
- func HandleYears(c *fiber.Ctx) error
- func OptionalAuth(c *fiber.Ctx) error
- func ParseFormInt(c *fiber.Ctx, fieldName string) (int, error)
- func ParseIntParam(c *fiber.Ctx, paramName string) (int, error)
- func RequireAdmin(c *fiber.Ctx) (*user.User, error)
- func RequireOwnership(c *fiber.Ctx, resourceUserID int) (*user.User, error)
- func ValidateAdForm(form *multipart.Form) error
- func ValidateAdFormAndReturn(form *multipart.Form) (years, models, engines, categories, subcategories []string, err error)
- func ValidateAndParsePrice(c *fiber.Ctx) (float64, error)
- func ValidateEmail(email string) error
- func ValidateRequired(c *fiber.Ctx, fieldName, displayName string) (string, error)
- func ValidateRequiredMultipart(form *multipart.Form, fieldName, displayName string) ([]string, error)
- func ValidationErrorResponse(c *fiber.Ctx, message string) error
- func ValidationErrorResponseWithStatus(c *fiber.Ctx, message string, statusCode int) error
- type GridView
- type ListView
- type MapView
- type Sitemap
- type SitemapURL
- type TreeView
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminRequired ¶
AdminRequired is a middleware that requires a user to be an admin.
func AuthRequired ¶
AuthRequired is a middleware that requires a user to be logged in.
func BuildAdFromForm ¶
func BuildAdFromForm(c *fiber.Ctx, userID int, locationID int, adID ...int) (ad.Ad, []*multipart.FileHeader, []int, error)
BuildAdFromForm builds an Ad struct from form data
func CurrentUser ¶
CurrentUser extracts the user from context, or falls back to session if not present.
func HandleAdCard ¶ added in v0.0.4
Handler for ad card (collapse)
func HandleAdDetail ¶ added in v0.0.4
Handler for ad detail (expanded view)
func HandleAdImage ¶ added in v0.0.4
Handler for HTMX image carousel
func HandleAdImageSignedURL ¶
Handler to get a signed B2 download URL for all images under an ad (prefix)
func HandleAdPage ¶ added in v0.0.4
func HandleAdRocks ¶ added in v0.0.4
HandleAdRocks displays the rock section for an ad
func HandleAdminB2Cache ¶ added in v0.0.3
func HandleAdminDashboard ¶
func HandleAdminEmbeddingCache ¶ added in v0.0.3
func HandleAdminVehicleCache ¶ added in v0.0.5
func HandleArchiveAd ¶
func HandleBookmarksPage ¶ added in v0.0.4
func HandleCategories ¶ added in v0.0.3
func HandleChangePassword ¶
func HandleClearB2Cache ¶ added in v0.0.3
func HandleClearQueryEmbeddingCache ¶ added in v0.0.5
func HandleClearSiteEmbeddingCache ¶ added in v0.0.5
func HandleClearUserEmbeddingCache ¶ added in v0.0.5
func HandleClearVehicleCache ¶ added in v0.0.5
func HandleCollapseConversation ¶ added in v0.0.4
HandleCollapseConversation handles collapsing a conversation back to the list view
func HandleDeleteAccount ¶
func HandleEditAd ¶
func HandleEditAdPartial ¶
Handler for ad edit partial (inline edit)
func HandleEngines ¶
func HandleExpandConversation ¶ added in v0.0.4
HandleExpandConversation handles expanding a conversation in-place
func HandleGridView ¶
func HandleHome ¶
func HandleListView ¶
func HandleLogin ¶
func HandleLoginSubmission ¶
func HandleLogout ¶
func HandleMakes ¶
func HandleMapView ¶
func HandleMessagesAPI ¶ added in v0.0.4
HandleMessagesAPI handles AJAX requests for messages
func HandleMessagesPage ¶ added in v0.0.4
HandleMessagesPage handles the main messages page
func HandleModels ¶
func HandleNewAd ¶
func HandleNewAdSubmission ¶
func HandleNotificationMethodChanged ¶ added in v0.0.4
HandleNotificationMethodChanged handles HTMX requests when notification method changes
func HandlePrivacyPolicy ¶ added in v0.0.3
HandlePrivacyPolicy displays the Privacy Policy page
func HandleRefreshB2Cache ¶ added in v0.0.5
func HandleRefreshB2Token ¶ added in v0.0.4
func HandleRefreshEmbeddingCache ¶ added in v0.0.5
func HandleRefreshVehicleCache ¶ added in v0.0.5
func HandleRegister ¶
func HandleRegistrationStep1 ¶ added in v0.0.3
HandleRegistrationStep1 handles the first step of registration (collecting user info)
func HandleRegistrationStep1Submission ¶ added in v0.0.3
HandleRegistrationStep1Submission handles the first step submission and sends SMS
func HandleRegistrationStep2Submission ¶ added in v0.0.3
HandleRegistrationStep2Submission handles verification code submission and completes registration
func HandleRegistrationVerification ¶ added in v0.0.3
HandleRegistrationVerification shows the verification code input page
func HandleResolveRock ¶ added in v0.0.4
HandleResolveRock resolves a rock dispute
func HandleRocksPage ¶ added in v0.0.4
HandleRocksPage displays the rocks page for newly verified users
func HandleSMSWebhook ¶ added in v0.0.4
HandleSMSWebhook processes Twilio webhook callbacks for SMS status updates
func HandleSSE ¶ added in v0.0.4
HandleSSE handles Server-Sent Events for real-time messaging updates
func HandleSSEConversationUpdate ¶ added in v0.0.4
HandleSSEConversationUpdate handles SSE requests for updated conversation items
func HandleSearch ¶
func HandleSearchAPI ¶ added in v0.0.3
HandleSearchAPI returns search results as JSON for JavaScript consumption
func HandleSearchPage ¶
func HandleSendMessage ¶ added in v0.0.4
HandleSendMessage handles sending a new message
func HandleSettings ¶
func HandleSitemap ¶ added in v0.0.5
func HandleStartConversation ¶ added in v0.0.4
HandleStartConversation handles starting a new conversation about an ad
func HandleSubCategories ¶ added in v0.0.3
func HandleTermsOfService ¶ added in v0.0.3
HandleTermsOfService displays the Terms of Service page
func HandleThrowRock ¶ added in v0.0.4
HandleThrowRock handles throwing a rock at an ad
func HandleTreeCollapseBrowse ¶ added in v0.0.4
func HandleTreeCollapseSearch ¶ added in v0.0.4
func HandleTreeExpandBrowse ¶ added in v0.0.4
func HandleTreeExpandSearch ¶ added in v0.0.4
func HandleTreeView ¶ added in v0.0.4
func HandleUpdateNotificationMethod ¶ added in v0.0.4
HandleUpdateNotificationMethod updates the user's notification method preference
func HandleUserMenu ¶ added in v0.0.4
func HandleViewRockConversations ¶ added in v0.0.4
HandleViewRockConversations displays the rock conversations for an ad
func HandleYears ¶
func OptionalAuth ¶
OptionalAuth is a middleware that checks for a user but does not require one.
func ParseFormInt ¶
ParseFormInt parses a form value as an integer with consistent error handling
func ParseIntParam ¶
ParseIntParam parses an integer parameter from the URL with consistent error handling
func RequireAdmin ¶
RequireAdmin extracts the user from context and checks admin status.
func RequireOwnership ¶
RequireOwnership checks if the current user owns the resource.
func ValidateAdForm ¶
ValidateAdForm validates the common ad form fields (years, models, engines, category, subcategory)
func ValidateAdFormAndReturn ¶
func ValidateAdFormAndReturn(form *multipart.Form) (years, models, engines, categories, subcategories []string, err error)
ValidateAdFormAndReturn validates ad form and returns the values
func ValidateAndParsePrice ¶
ValidateAndParsePrice validates and parses a price field
func ValidateEmail ¶ added in v0.0.4
ValidateEmail validates that a string is a valid email address
func ValidateRequired ¶
ValidateRequired validates that a required form field is not empty
func ValidateRequiredMultipart ¶
func ValidateRequiredMultipart(form *multipart.Form, fieldName, displayName string) ([]string, error)
ValidateRequiredMultipart validates that a required multipart form field has at least one value
func ValidationErrorResponse ¶
ValidationErrorResponse returns a validation error response
Types ¶
type GridView ¶ added in v0.0.4
type GridView struct {
// contains filtered or unexported fields
}
GridView implements the View interface for grid view
func NewGridView ¶ added in v0.0.4
NewGridView creates a new grid view
func (*GridView) RenderSearchPage ¶ added in v0.0.4
type ListView ¶ added in v0.0.4
type ListView struct {
// contains filtered or unexported fields
}
ListView implements the View interface for list view
func NewListView ¶ added in v0.0.4
NewListView creates a new list view
func (*ListView) RenderSearchPage ¶ added in v0.0.4
type MapView ¶ added in v0.0.4
type MapView struct {
// contains filtered or unexported fields
}
MapView implements the View interface for map view
func NewMapView ¶ added in v0.0.4
NewMapView creates a new map view
func (*MapView) RenderSearchPage ¶ added in v0.0.4
type Sitemap ¶ added in v0.0.5
type Sitemap struct {
XMLName xml.Name `xml:"urlset"`
Xmlns string `xml:"xmlns,attr"`
URLs []SitemapURL `xml:"url"`
}
type SitemapURL ¶ added in v0.0.5
type TreeView ¶
type TreeView struct {
// contains filtered or unexported fields
}
TreeView implements the View interface for tree view
func NewTreeView ¶ added in v0.0.4
NewTreeView creates a new tree view
func (*TreeView) RenderSearchPage ¶ added in v0.0.4
type View ¶ added in v0.0.4
type View interface {
// GetAdIDs retrieves ad IDs for this view with appropriate search strategy
GetAdIDs() ([]int, string, error)
// RenderSearchResults renders the complete search results including container, ads, and pagination
RenderSearchResults(adIDs []int, nextCursor string) error
// RenderSearchPage renders just the ads and infinite scroll for pagination
RenderSearchPage(adIDs []int, nextCursor string) error
}
View interface defines the contract for different view implementations