bhaweshksingh / statistico-betfair-go-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Statistico Betfair Go Client

Documentation CircleCI

This library is a Golang wrapper around the Betfair Accounts and Betting API. Full documentation and API reference can be found here:

Documentation

Installation

$ go get -u github.com/statistico/statistico-betfair-go-client

Usage

To instantiate the required Client struct and retrieve a Competition resources:

package main

import (
    "context"
    "fmt"
    "github.com/statistico/statistico-betfair-go-client"
)

func main() {
    creds := betfair.InteractiveCredentials{
        Username:   "user@email.com",
        Password:   "my-secret-password-1",
        Key :       "thUjaEEdBy",
    }
	
	client := *http.Client{}
	
	store := myimplementation.Store{}
    
    bfClient := betfair.NewClient(client, creds, store) 
    
    competitions, err := bfClient.ListCompetitions(context.Background(), ListCompetitionsRequest{}) 

    if err != nil {
        fmt.Printf("%s\n", err)
        return
    }

    // Do something with competitions variable
}

Contributing

You are more than welcome to contribute to this project. Fork and make a Pull Request, or create an Issue if you notice any problems or would like to suggest improvements.

About


Languages

Language:Go 100.0%