bovada

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 8 Imported by: 0

README

Bovada

Go Report Card

To install the command line tool:

go install github.com/adayNU/bovada/cmd/bovctl

Usage:

Usage of bovctl:
  -d string
    	Limits events to a certain day ("today", "tomorrow", "all"') (default "all")
  -l string
    	Specify which league to query events for ("mlb", "nba"", "nhl"). (default "mlb")
  -n int
    	Number of events to chose a bet for. (default 1)
  -u	Upcoming events only

Contributors

Interested in contributing? Open a pull request.

Documentation

Overview

Package bovada provides a means of querying the Bovada API to determine upcoming events for US professional sports leagues.

Index

Constants

View Source
const (
	// Host is the hostname for Bovada.
	Host = "www.bovada.lv"
	// MLBPath is the path for the MLB events endpoint.
	MLBPath = "services/sports/event/coupon/events/A/description/baseball/mlb"
	// NBAPath is the path for the NBA events endpoint.
	NBAPath = "services/sports/event/coupon/events/A/description/basketball/nba"
	// NHLPath is the path for the NHL events endpoint.
	NHLPath = "services/sports/event/coupon/events/A/description/hockey/nhl"
	// NFLPath is the path for the NFL events endpoint.
	NFLPath = "services/sports/event/coupon/events/A/description/football/nfl"
	// CFBPath is the path for the NCAA College Football events endpoint.
	CFBPath = "services/sports/event/coupon/events/A/description/football/college-football"
)

Variables

View Source
var (

	// ErrNoEvents means the query was a success, but returned
	// no events.
	ErrNoEvents = errors.New("no events returned")
)

Functions

func NewQueryOpts

func NewQueryOpts() *queryOpts

NewQueryOpts returns a |*queryOpts| with the language set to English.

Types

type Client

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

Client implements methods for interacting with the Bovada API.

func NewClient

func NewClient(c *http.Client) *Client

NewClient returns a new |*Client|. If a nil *http.Client is passed, it uses the http.DefaultClient.

func (*Client) GetEvents

func (c *Client) GetEvents(path string, opts *queryOpts) (*EventResponse, error)

GetEvents queries the API for the given path and with the specified options.

type EventResponse

type EventResponse struct {
	Paths  []path  `json:"path"`
	Events []event `json:"events"`
}

EventResponse is the data returned from an API call.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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