Categorygithub.com/leonb/irsdk-go
modulepackage
0.0.0-20151111020111-8dab19ab7858
Repository: https://github.com/leonb/irsdk-go.git
Documentation: pkg.go.dev

# README

irsdk in Go

This is a port of the iRacing sdk to Go. The iRacing sdk logic is ported and slightly modified to make it a bit more go-y.

The initial idea for porting it to go was to make it compatible with the Linux version of iRacing (which runs under wine / CrossOver). I choose Go because of the (small) cross-platform standalone binaries without dependencies on a third-party frameworks (.Net).

This doesn't mean it's Linux only. Go runs fine on Windows and this library should work fine on Windows (not tested).

Installation

Windows

go get github.com/LeonB/irsdk-go

Linux

GOARCH=386 GOOS=windows go get github.com/LeonB/irsdk-go

Example

package main

import (
	"fmt"
	"log"

	irsdk "github.com/leonb/irsdk-go"
)

func main() {
	conn, err := irsdk.NewConnection()
	if err != nil {
		log.Fatal(err)
	}

	err = conn.Connect()
	if err != nil {
		log.Fatal(err)
	}

	fields := []string{}

	for {
		telemetryData, err := conn.GetTelemetryDataFiltered(fields)
		if err != nil {
			log.Println(err)
		}

		fmt.Printf("%+v\n", telemetryData)
	}
}

Terminalhud

This repository contains a sample program terminalhud:

iRacing Terminalhud

Known bugs / pitfalls

  • When running it under wine, Go time functions do not work: go-nuts thread / wine bug
  • broadcastmsg doesn't work (no idea why)

Inspiration

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
@TODO: should this accept an io.Reader?.
NewTelemetryReader intializes a new TelemetryReader object based on an io.ReadSeeker.

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author