bgg

package
v0.0.0-...-ce806dc Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BggApi

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

func NewBggApi

func NewBggApi() *BggApi

func (*BggApi) GetFamily

func (bgg *BggApi) GetFamily(ctx context.Context, id int64) (*Family, error)

func (*BggApi) GetGame

func (bgg *BggApi) GetGame(ctx context.Context, id int64) (*Game, error)

type Family

type Family struct {
	Item struct {
		Type string `xml:"type,attr"`
		ID   int64  `xml:"id,attr"`
		Name struct {
			Value string `xml:"value,attr"`
		} `xml:"name"`
		Link []struct {
			Type  string `xml:"type,attr"`
			ID    int64  `xml:"id,attr"`
			Value string `xml:"value,attr"`
		} `xml:"link"`
	} `xml:"item"`
}

type Game

type Game struct {
	Item struct {
		Type          string `xml:"type,attr"`
		ID            int64  `xml:"id,attr"`
		YearPublished struct {
			Text  string `xml:",chardata"`
			Value int64  `xml:"value,attr"`
		} `xml:"yearpublished"`
		Name []struct {
			Type  string `xml:"type,attr"`
			Value string `xml:"value,attr"`
		} `xml:"name"`
		Description string `xml:"description"`
		Link        []struct {
			Type  string `xml:"type,attr"`
			ID    int64  `xml:"id,attr"`
			Value string `xml:"value,attr"`
		} `xml:"link"`
		Statistics struct {
			Ratings struct {
				Text       string `xml:",chardata"`
				NumRatings struct {
					Text  string `xml:",chardata"`
					Value int64  `xml:"value,attr"`
				} `xml:"usersrated"`
				Average struct {
					Text  string  `xml:",chardata"`
					Value float64 `xml:"value,attr"`
				} `xml:"average"`
			} `xml:"ratings"`
		} `xml:"statistics"`
	} `xml:"item"`
}

XML tags generated from https://www.onlinetool.io/xmltogo/ Game can be a game, or expansion, see the Item.Type field.

Jump to

Keyboard shortcuts

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