goespn

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 13 Imported by: 0

README

goespn

Golang ESPN API Client Library

Todo

  • Standings
  • News
  • Scoreboard
  • Teams

Documentation

Index

Constants

View Source
const (
	SportSoccer     = "soccer"
	SportFootball   = "football"
	SportBaseball   = "baseball"
	SportHockey     = "hockey"
	SportBasketball = "basketball"
)

List of Sport

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NewRequest(method string, fullPath string, body io.Reader) (*http.Request, error)
	ExecuteRequest(req *http.Request, v interface{}) error
	Call(method, path string, body io.Reader, v interface{}) error
}

Client : client interface

func NewClient

func NewClient() Client

NewClient : this function will always be called when the library is in use

type CoreGateway

type CoreGateway struct {
	Client   Client
	SportID  string
	LeagueID string
}

CoreGateway .

func (*CoreGateway) Call

func (gateway *CoreGateway) Call(method, path string, body io.Reader, v interface{}) error

Call : base method to call Core API

func (*CoreGateway) GetStandings

func (gateway *CoreGateway) GetStandings() (interface{}, error)

GetStandings : get league standings

type ICoreGateway

type ICoreGateway interface {
	GetStandings() (interface{}, error)
}

ICoreGateway .

func NewCoreGateway

func NewCoreGateway(client Client, sportID, leagueID string) ICoreGateway

NewCoreGateway .

Jump to

Keyboard shortcuts

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