Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssembleDescription ¶
func AssembleDescription(original string, history []HistoryEntryJSON, createdAt time.Time) (string, error)
AssembleDescription applies seed history entries to the original body.
func LoadCategories ¶
func LoadCategories() error
LoadCategories loads ad-category.json into categories
Types ¶
type Ad ¶
type Ad struct {
ID int
CategoryID int
Title string
Description string
Price float64
CreatedAt string
UserID int
ImageCount int
Location LocationData
}
Ad represents an ad for loading purposes
type CategoryFiles ¶
CategoryFiles stores file information for a category
type HistoryEntryJSON ¶
type HistoryEntryJSON struct {
Label string `json:"label"`
Body string `json:"body"`
At string `json:"at"`
}
HistoryEntryJSON is one description edit-history block in seed ad files.
type LocationData ¶
type LocationData struct {
City string `json:"city"`
AdminArea string `json:"admin_area"`
Country string `json:"country"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
}
LocationData represents location data from ad JSON files
type SuggestionJSON ¶
SuggestionJSON is one description tag in seed ad files.