Documentation
¶
Overview ¶
Package eansearch is a Go module for EAN, GTIN and ISBN name lookup and validation
Index ¶
- Constants
- func BarcodeImage(ean string) ([]byte, error)
- func CreditsRemaining() (int, error)
- func FindAsinForEan(ean string) (string, error)
- func FindEanForAsin(asin string) (string, error)
- func FindEanForLccn(lccn string) (string, error)
- func FindLccnForEan(ean string) (string, error)
- func IssuingCountryLookup(ean string) (string, error)
- func SetToken(t string) error
- func VerifyChecksum(ean string) (bool, error)
- type AsinLookup
- type AsinOrError
- type Checksum
- type ChecksumOrError
- type ExtProduct
- type ExtProductOrError
- type Image
- type ImageOrError
- type LccnLookup
- type LccnOrError
- type Product
- func BarcodePrefixSearch(prefix string, page uint, lang uint) ([]Product, bool, error)
- func CategorySearch(category uint, name string, page uint, lang uint) ([]Product, bool, error)
- func ISBNLookup(isbn string) ([]Product, error)
- func ProductSearch(name string, page uint, lang uint) ([]Product, bool, error)
- func SimilarProductSearch(name string, page uint, lang uint) ([]Product, bool, error)
- type ProductOrError
Constants ¶
const AnyLanguage uint = 99
const Danish uint = 2
const Dutch uint = 10
const English uint = 1
const Finish uint = 5
const French uint = 6
const German uint = 3
const Italian uint = 8
const MaxApiTries uint = 3
const Norwegian uint = 11
const Polish uint = 12
const Portuguese uint = 13
const Spanish uint = 4
const Swedish uint = 15
Variables ¶
This section is empty.
Functions ¶
func BarcodeImage ¶ added in v1.3.0
func CreditsRemaining ¶ added in v1.6.0
CreditsRemaining returns the number of remaining API credits
func FindAsinForEan ¶ added in v1.6.0
FindAsinForEan finds the Amazon ASIN for an EAN or ISBN-13 barcode
func FindEanForAsin ¶ added in v1.6.0
FindEanForAsin finds the EAN barcode for an Amazon ASIN
func FindEanForLccn ¶ added in v1.6.0
FindEanForLccn finds the EAN barcode for a Library of Congress Control Number (LCCN) There can be multiple EANs for one LCCN, this returns the first one found.
func FindLccnForEan ¶ added in v1.6.0
FindLccnForEan finds the Library of Congress Control Number (LCCN) for an EAN or ISBN-13 barcode
func IssuingCountryLookup ¶ added in v1.3.0
func SetToken ¶
SetToken initialises the API with the token, you can apply for at https://www.ean-search.org/ean-database-api.html
func VerifyChecksum ¶ added in v1.3.0
Types ¶
type AsinLookup ¶ added in v1.6.0
type AsinOrError ¶ added in v1.6.0
type AsinOrError struct {
AsinLookup
Error string
}
type ChecksumOrError ¶ added in v1.3.0
type ExtProduct ¶ added in v1.5.0
type ExtProduct struct {
Ean string
Name string
CategoryID uint `json:",string"`
CategoryName string
GoogleCategoryID uint `json:",string"`
IssuingCountry string
}
func BarcodeLookup ¶
func BarcodeLookup(ean string, lang uint) ([]ExtProduct, error)
BarcodeLookup searches for a single EAN code
type ExtProductOrError ¶ added in v1.5.0
type ExtProductOrError struct {
ExtProduct
Error string
}
type ImageOrError ¶ added in v1.3.0
type LccnLookup ¶ added in v1.6.0
type LccnOrError ¶ added in v1.6.0
type LccnOrError struct {
LccnLookup
Error string
}
type Product ¶
type Product struct {
Ean string
Name string
CategoryID uint `json:",string"`
CategoryName string
IssuingCountry string
}
Product holds datasets returned by the API
func BarcodePrefixSearch ¶
BarcodePrefixSearch find all EANs strating with a certain prefix
func CategorySearch ¶ added in v1.3.0
CategorySearch searches for products by category and name
func ISBNLookup ¶ added in v1.3.0
ISBNLookup searches for a single ISBN-10 or ISBN-13 code
func ProductSearch ¶
ProductSearch searches for products by name (exact)