ability

package
v0.0.0-...-3f4e590 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownError    = errors.New("Something is wrong")
	ErrAbilityNotFound = errors.New("Pokedex ability cannot be found")
)

Functions

func WithClientTimeout

func WithClientTimeout(timeout time.Duration) func(client *client)

Types

type Client

type Client interface {
	FindOneByID(id int) (godex.Ability, error)
	// allow partial result, suppress error
	FindAllByIDs(ids []int) godex.Abilities
}

func NewClient

func NewClient(baseURL string, options ...func(*client)) Client

type Service

type Service interface {
	GetAbilityByID(id int) (godex.Ability, error)
	GetAbilitiesByIDs(ids []int) godex.Abilities
}

func NewService

func NewService(config ServiceConfig) Service

type ServiceConfig

type ServiceConfig struct {
	APIBaseURL string
}

Jump to

Keyboard shortcuts

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