scryfall

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Download(string, string) error
	GetImageURL(*dataobjects.CardDetail) (string, error)
	GetSetDetails() ([]dataobjects.SetDetail, error)
}

Interface for my scryfall package

type Payload

type Payload struct {
	Data []struct {
		Set        string `json:"set"`
		ImagesUris struct {
			Png string `json:"png"`
		} `json:"image_uris"`
		CardFaces []struct {
			ImagesUris struct {
				Png string `json:"png"`
			} `json:"image_uris"`
		} `json:"card_faces"`
	} `json:"data"`
}

Payload json structure Potentially will move over to https://github.com/BlueMonday/go-scryfall // though we'll keep what I have for now

type Struct

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

Struct of a scryfall

func Create

func Create() *Struct

Create Scryfall

func CreateWithInterface

func CreateWithInterface(wd waitdo.Interface) *Struct

CreateWithInterface scryfall

func (*Struct) Download

func (sf *Struct) Download(scryfallURL string, filename string) (err error)

Download given URL from scryfall with to call the resulting file

func (*Struct) GetImageURL

func (sf *Struct) GetImageURL(cd *dataobjects.CardDetail) (imageURL string, err error)

GetImageURL from scryfall using a specific card detail

func (*Struct) GetSetDetails

func (sf *Struct) GetSetDetails() (setDetails []dataobjects.SetDetail, err error)

GetSetDetails from scryfall (details being the full spelling of a set name and set abbreviation)

Jump to

Keyboard shortcuts

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