Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forum ¶
type Forum struct { ID int `xml:"id,attr"` Title string `xml:"title,attr"` NumThreads int `xml:"numthreads,attr"` NumPosts int `xml:"numposts,attr"` LastPostDate string `xml:"lastpostdate,attr"` NoPosting int `xml:"noposting,attr"` Threads []Thread `xml:"threads>thread"` }
func Query ¶
Query retrieves detailed information about a specific forum from the BoardGameGeek API.
The function accepts a forum ID and returns a structured representation of the forum details including the forum title, threads within the forum, and metadata such as post counts and dates.
Parameters:
- id: An integer ID corresponding to a forum in the BGG database
Returns:
- *Forum: A pointer to a Forum struct containing the forum information and threads
- error: An error if the API request fails or if the response cannot be parsed
Example:
forum, err := forum.Query(1234) if err != nil { log.Fatalf("Failed to get forum: %v", err) } fmt.Printf("Forum title: %s (contains %d threads)\n", forum.Title, forum.NumThreads)
Click to show internal directories.
Click to hide internal directories.