net

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardFetcher

type CardFetcher struct{}

CardFetcher is a simple type for fetching images directly from a URL.

func (*CardFetcher) GetCardImage

func (cf *CardFetcher) GetCardImage(ctx context.Context, imageURL string) (
	data []byte, err error)

GetCardImage implements the forgefs.CardImageFetcher interface.

type DoKAPI

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

DoKAPI enables API calls to the decksofkeyforge server. Calls are rate-limited to ensure compliance with the decksofkeyforge API rules.

func NewDoKAPI

func NewDoKAPI(addr, apiKey string) *DoKAPI

NewDoKAPI returns a new instance using the given address and API key.

func (*DoKAPI) GetCards

func (da *DoKAPI) GetCards(ctx context.Context) (
	cards []forgefs.Card, err error)

GetCards implements the forgefs.DataFetcher interface.

func (*DoKAPI) GetDeck

func (da *DoKAPI) GetDeck(ctx context.Context, id string, deck *forgefs.Deck) (
	updatedDeck forgefs.Deck, err error)

GetDeck implements the forgefs.DataFetcher interface.

func (*DoKAPI) GetMyDecks

func (da *DoKAPI) GetMyDecks(ctx context.Context) (
	decks []forgefs.Deck, err error)

GetMyDecks implements the forgefs.DataFetcher interface.

type SkyJAPI

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

SkyJAPI enables fetching of deck list images from SkyJedi's TTS server. Requests are rate-limited to be nice.

func NewSkyJAPI

func NewSkyJAPI(baseURL string) *SkyJAPI

NewSkyJAPI returns a new instance of SkyJAPI.

func (*SkyJAPI) GetDeckImage

func (sja *SkyJAPI) GetDeckImage(ctx context.Context, deckID string) (
	data []byte, err error)

GetDeckImage implements the forgefs.DeckImageFetcher interface.

func (*SkyJAPI) GetDeckImageSuffix

func (sja *SkyJAPI) GetDeckImageSuffix() string

GetDeckImageSuffix implements the forgefs.DeckImageFetcher interface.

Jump to

Keyboard shortcuts

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