Help us shape the future of Go! Take the 2026 Go Developer Survey

rsi

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

README

# GoScrapeRSI

[![Go Version](https://img.shields.io/badge/Go-1.26.3-blue.svg)](https://golang.org)
[![License](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](LICENSE)

A comprehensive Go client library for the Roberts Space Industries (RSI) API, providing programmatic access to Star Citizen data including user profiles, organizations, ships, roadmaps, statistics, starmap information, and more.

## Overview

GoScrapeRSI is a robust Go package that simplifies interaction with RSI's public APIs. It provides a clean, type-safe interface for fetching and parsing Star Citizen game data, making it easy to build tools, bots, and applications around the Star Citizen universe.

## Features

- **User Profiles**: Fetch detailed citizen profiles including bio, organization membership, and affiliations
- **Organizations**: Retrieve organization details, members, and search functionality
- **Ships**: Search and filter ships by name, classification, size, crew, price, and other attributes
- **Roadmap**: Access development roadmaps for Star Citizen and Squadron 42
- **Statistics**: Get real-time crowdfunding stats, player counts, and version information
- **Starmap**: Query star systems, tunnels, species, affiliations, and celestial objects
- **Telemetry**: Fetch game telemetry data with time-based filtering
- **Patch Notes**: Retrieve Star Citizen patch notes and version history
- **Progress Tracker**: Access team progress tracking and development schedules
- **VCR Support**: Built-in support for go-vcr for testing with recorded HTTP responses
- **Concurrent Processing**: Efficient parallel data fetching where appropriate

## Requirements

- Go 1.26.3 or higher
- Internet connection to access RSI APIs

### Dependencies

```go
github.com/antchfx/htmlquery v1.3.6
golang.org/x/net v0.55.0
gopkg.in/dnaeon/go-vcr.v2 v2.3.0
```

## Installation

Install the package using `go get`:

```bash
go get github.com/koo04/GoScrapeRSI
```

Or add it to your `go.mod`:

```go
require github.com/koo04/GoScrapeRSI v0.7.0
```

Then run:

```bash
go mod tidy
```

## Module Descriptions

### Client

The main entry point providing a unified interface to all RSI API endpoints. Supports custom timeouts and connector configurations for testing.

### User

Fetches citizen profiles including display name, handle, organization membership, affiliations, enlistment date, bio, and profile images.

### Organization

Retrieves organization information including SID, name, focus, members, archetype, commitment level, and detailed manifesto/charter content.

### Ship

Searches and filters ship information with support for multiple criteria (name, classification, dimensions, crew size, price ranges).

### Roadmap

Accesses development roadmaps for both Star Citizen and Squadron 42, including releases, cards, categories, and descriptions.

### Stats

Fetches real-time statistics including total backers, crowdfunding amounts, fleet size, and current game versions (Live, PTU, ETF).

### Starmap

Comprehensive starmap querying for:

- Star systems and their properties
- Jump point tunnels
- Alien species
- Political affiliations
- Celestial objects (planets, moons, stations)
- Route finding between systems

### Telemetry

Retrieves game telemetry data with support for daily, weekly, and monthly aggregations filtered by game version.

### Version/Patch Notes

Fetches patch note history with titles, versions, images, and links to full patch details.

### Progress Tracker

Accesses CIG team progress tracking data including deliverables, schedules, and completion estimates.

### Connector

Low-level HTTP transport handler supporting proxy configuration, custom user agents, and request/response processing.

## Basic Usage

### Simple Example

```go
package main

import (
    "context"
    "fmt"
    "log"

    rsi "github.com/koo04/GoScrapeRSI"
)

func main() {
    // Create a new client
    client := rsi.NewClient()
    ctx := context.Background()

    // Fetch a user profile
    user, err := client.GetUser(ctx, "KooTheGreat")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("User: %s (Handle: %s)\n", user.Profile.Display, user.Profile.Handle)
    fmt.Printf("Enlisted: %s\n", user.Profile.Enlisted)

    // Get current game statistics
    stats, err := client.GetStats(ctx)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Total Fans: %d\n", stats.Fans)
    fmt.Printf("Funds Raised: $%.2f\n", stats.Funds)
}
```

### Advanced Examples

#### Fetch Organization Details

```go
client := rsi.NewClient()
ctx := context.Background()

org, err := client.GetOrganization(ctx, "TEST")
if err != nil {
    log.Fatal(err)
}

fmt.Printf("Organization: %s (%s)\n", org.Name, org.SID)
fmt.Printf("Members: %d\n", org.Members)
fmt.Printf("Focus: %s\n", org.Focus.Primary.Name)
```

#### Search for Ships

```go
client := rsi.NewClient()
ctx := context.Background()

// Search for medium-sized ships priced between $100-$300
ships, err := client.SearchShips(ctx, map[string]any{
    "classification": []string{"medium"},
    "price_min":      100,
    "price_max":      300,
})
if err != nil {
    log.Fatal(err)
}

for _, ship := range ships {
    fmt.Printf("Ship: %s - $%.2f\n", ship["name"], ship["price"])
}
```

#### Query Starmap

```go
client := rsi.NewClient()
ctx := context.Background()

// Search for Stanton system
systems, err := client.GetStarmapSystems(ctx, "Stanton")
if err != nil {
    log.Fatal(err)
}

for _, system := range systems {
    fmt.Printf("System: %s\n", system["name"])
}

// Find route between systems
route, err := client.SearchStarmapRoute(ctx, "SOL", "STANTON", "M")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Route distance: %v\n", route.Distance)
```

#### Get Development Roadmap

```go
client := rsi.NewClient()
ctx := context.Background()

// Fetch Star Citizen roadmap
roadmap, err := client.GetRoadmap(ctx, "starcitizen", "")
if err != nil {
    log.Fatal(err)
}

for _, release := range roadmap {
    fmt.Printf("Release: %s\n", release.Name)
    fmt.Printf("  Cards: %d\n", len(release.Cards))
}
```

#### Custom Timeout and Proxy

```go
// Create client with custom timeout
client := rsi.NewClientWithTimeout(10 * time.Second)

// Proxy configuration via environment variable
// Set HTTP_PROXY before creating connector
os.Setenv("HTTP_PROXY", "http://proxy.example.com:8080")
connector := rsi.NewConnector()
client = rsi.NewClientWithConnector(connector)
```

## Testing

The library includes comprehensive test coverage using go-vcr for recording and replaying HTTP interactions:

```bash
go test ./...
```

Test cassettes are stored in `testdata/cassettes/` for reproducible testing without network calls.

## Contributing

Contributions are welcome! Please feel free to submit issues, fork the repository, and create pull requests.

## License

This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- Built for the Star Citizen community
- Uses RSI's public APIs/Website
- Inspired by similar Python implementations

## Disclaimer

This is an unofficial third-party library and is not affiliated with, endorsed by, or connected to Cloud Imperium Games or Roberts Space Industries. Star Citizen®, Roberts Space Industries®, and Cloud Imperium® are registered trademarks of Cloud Imperium Games Corporation.

Documentation

Overview

Package rsi provides a Go client for the Roberts Space Industries (RSI) API. It allows fetching information about Star Citizen users, organizations, ships, roadmaps, statistics, and more.

Index

Constants

View Source
const (
	// BaseURL is the RSI API base URL
	BaseURL = "https://robertsspaceindustries.com"

	// DefaultTimeout is the default request timeout
	DefaultTimeout = 5 * time.Second
)

Variables

View Source
var (
	ErrNotFound        = errors.New("resource not found")
	ErrUnauthorized    = errors.New("unauthorized")
	ErrThrottled       = errors.New("API throttled")
	ErrInvalidResponse = errors.New("invalid response format")
	ErrEmptyResponse   = errors.New("empty response")
)

Functions

func ConvertVal

func ConvertVal(val any, target string) any

ConvertVal converts an interface{} value to a specific type based on target Mimics Python's convert_val method from ICommand

func HTTPFormatter

func HTTPFormatter(val any) string

HTTPFormatter formats values for HTTP query parameters Mimics Python's http_formatter method

func RangeFormatter

func RangeFormatter(min, max any) string

RangeFormatter formats min/max range values as "min,max"

Types

type Client

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

Client provides a convenient interface to RSI APIs

func NewClient

func NewClient() *Client

NewClient creates a new RSI API client with default settings

func NewClientWithConnector

func NewClientWithConnector(conn *Connector) *Client

NewClientWithConnector creates a client with a custom connector Useful for testing with VCR or custom transport configurations

func NewClientWithTimeout

func NewClientWithTimeout(timeout time.Duration) *Client

NewClientWithTimeout creates a new RSI API client with a custom timeout

func (*Client) GetOrganization

func (c *Client) GetOrganization(ctx context.Context, sid string) (*OrganizationData, error)

GetOrganization fetches organization details by SID

func (*Client) GetOrganizationMembers

func (c *Client) GetOrganizationMembers(ctx context.Context, sid string, page int, options map[string]any) ([]OrganizationMember, error)

GetOrganizationMembers fetches organization members with pagination and filters

func (*Client) GetPatchNotes

func (c *Client) GetPatchNotes(ctx context.Context) ([]PatchNote, error)

GetPatchNotes fetches Star Citizen patch notes

func (*Client) GetProgressTrackerInfo

func (c *Client) GetProgressTrackerInfo(ctx context.Context, teamSlug, dateMin, dateMax string) ([]map[string]any, error)

GetProgressTrackerInfo fetches detailed progress tracker info for a team

func (*Client) GetProgressTrackerTeams

func (c *Client) GetProgressTrackerTeams(ctx context.Context, dateMin, dateMax string) ([]map[string]any, error)

GetProgressTrackerTeams fetches progress tracker teams data

func (*Client) GetRoadmap

func (c *Client) GetRoadmap(ctx context.Context, board, version string) ([]RoadmapRelease, error)

GetRoadmap fetches roadmap data for a specific board board: "starcitizen" or "squadron42" version: optional version filter

func (*Client) GetStarmapAffiliations

func (c *Client) GetStarmapAffiliations(ctx context.Context, name string) ([]map[string]any, error)

GetStarmapAffiliations fetches starmap affiliations, optionally filtered by name or code

func (*Client) GetStarmapCelestialObject

func (c *Client) GetStarmapCelestialObject(ctx context.Context, code string) ([]map[string]any, error)

GetStarmapCelestialObject fetches celestial object details by code

func (*Client) GetStarmapSpecies

func (c *Client) GetStarmapSpecies(ctx context.Context, name string) ([]map[string]any, error)

GetStarmapSpecies fetches starmap species, optionally filtered by name or code

func (*Client) GetStarmapStarSystem

func (c *Client) GetStarmapStarSystem(ctx context.Context, code string) ([]map[string]any, error)

GetStarmapStarSystem fetches star system details by code

func (*Client) GetStarmapSystems

func (c *Client) GetStarmapSystems(ctx context.Context, name string) ([]map[string]any, error)

GetStarmapSystems fetches starmap systems, optionally filtered by name

func (*Client) GetStarmapTunnels

func (c *Client) GetStarmapTunnels(ctx context.Context, tid string) ([]map[string]any, error)

GetStarmapTunnels fetches starmap tunnels, optionally filtered by ID

func (*Client) GetStats

func (c *Client) GetStats(ctx context.Context) (*StatsData, error)

GetStats fetches general RSI statistics

func (*Client) GetTelemetry

func (c *Client) GetTelemetry(ctx context.Context, timetable, version string) (map[string]any, error)

GetTelemetry fetches telemetry data timetable: "DAY", "WEEK", or "MONTH" version: game version (e.g., "3.17.0")

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, handle string) (*UserProfile, error)

GetUser fetches a user profile by handle

func (*Client) SearchShips

func (c *Client) SearchShips(ctx context.Context, options map[string]any) ([]map[string]any, error)

SearchShips searches for ships with the given criteria

func (*Client) SearchStarmap

func (c *Client) SearchStarmap(ctx context.Context, query string) (*StarmapSearchResult, error)

SearchStarmap performs a starmap search

func (*Client) SearchStarmapRoute

func (c *Client) SearchStarmapRoute(ctx context.Context, from, to, shipSize string) (*StarmapRouteResult, error)

SearchStarmapRoute finds routes between systems shipSize: S, M, or L

type Command

type Command interface {
	Execute(ctx context.Context) (any, error)
}

Command represents an executable RSI API command

type Connector

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

Connector handles HTTP transport to RSI endpoints

func NewConnector

func NewConnector() *Connector

NewConnector creates a new RSI API connector

func NewConnectorWithClient

func NewConnectorWithClient(client *http.Client) *Connector

NewConnectorWithClient creates a connector with a custom HTTP client Useful for testing with VCR or custom transport configurations

func (*Connector) Client

func (c *Connector) Client() *http.Client

Client returns the underlying HTTP client for advanced usage

func (*Connector) ConvertPath

func (c *Connector) ConvertPath(path string) string

ConvertPath joins a path with the base URL

func (*Connector) Get

func (c *Connector) Get(ctx context.Context, path string, headers map[string]string) (*http.Response, error)

Get performs a GET request

func (*Connector) Post

func (c *Connector) Post(ctx context.Context, path string, body any, headers map[string]string) (*http.Response, error)

Post performs a POST request

func (*Connector) Request

func (c *Connector) Request(ctx context.Context, method, path string, body any, headers map[string]string) (*http.Response, error)

Request performs an HTTP request to the RSI API

type FocusInfo

type FocusInfo struct {
	Image string `json:"image,omitempty"`
	Name  string `json:"name,omitempty"`
}

FocusInfo contains focus details

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
	URL        string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Organization

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

Organization fetches organization information

func NewOrganization

func NewOrganization(sid string) *Organization

NewOrganization creates a new organization fetcher

func (*Organization) Execute

func (o *Organization) Execute(ctx context.Context) (*OrganizationData, error)

Execute fetches organization data using concurrent goroutines

type OrganizationData

type OrganizationData struct {
	URL       string            `json:"url"`
	SID       string            `json:"sid"`
	Name      string            `json:"name,omitempty"`
	Focus     OrganizationFocus `json:"focus"`
	Banner    string            `json:"banner,omitempty"`
	Headline  TextContent       `json:"headline"`
	History   TextContent       `json:"history"`
	Manifesto TextContent       `json:"manifesto"`
	Charter   TextContent       `json:"charter"`
	// Fields from search
	Href       string `json:"href,omitempty"`
	Archetype  string `json:"archetype,omitempty"`
	Lang       string `json:"lang,omitempty"`
	Commitment string `json:"commitment,omitempty"`
	Recruiting bool   `json:"recruiting"`
	Roleplay   bool   `json:"roleplay"`
	Members    int    `json:"members"`
}

OrganizationData represents complete organization information

type OrganizationFocus

type OrganizationFocus struct {
	Primary   FocusInfo `json:"primary"`
	Secondary FocusInfo `json:"secondary"`
}

OrganizationFocus contains primary and secondary focus

type OrganizationInfo

type OrganizationInfo struct {
	Image string `json:"image,omitempty"`
	Name  string `json:"name,omitempty"`
	SID   string `json:"sid,omitempty"`
	Rank  string `json:"rank,omitempty"`
	Stars int    `json:"stars"`
}

OrganizationInfo contains main organization details

type OrganizationMember

type OrganizationMember struct {
	Handle  string   `json:"handle"`
	Display string   `json:"display,omitempty"`
	Stars   int      `json:"stars"`
	Rank    string   `json:"rank,omitempty"`
	Roles   []string `json:"roles"`
	Image   string   `json:"image,omitempty"`
}

OrganizationMember represents a single organization member

type OrganizationMembers

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

OrganizationMembers fetches organization members

func NewOrganizationMembers

func NewOrganizationMembers(sid string, page int, options map[string]any) *OrganizationMembers

NewOrganizationMembers creates a new organization members fetcher

func (*OrganizationMembers) Execute

Execute fetches organization members

type PageInfo

type PageInfo struct {
	URL   string `json:"url"`
	Title string `json:"title,omitempty"`
}

PageInfo contains page metadata

type ParseError

type ParseError struct {
	Source string
	Field  string
	Err    error
}

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type PatchNote

type PatchNote struct {
	Link    string `json:"link"`
	Title   string `json:"title"`
	Version string `json:"version,omitempty"`
	Image   string `json:"image,omitempty"`
}

PatchNote represents a single patch note entry

type ProfileInfo

type ProfileInfo struct {
	Page       PageInfo          `json:"page"`
	ID         string            `json:"id,omitempty"`
	Display    string            `json:"display,omitempty"`
	Handle     string            `json:"handle,omitempty"`
	Badge      string            `json:"badge,omitempty"`
	BadgeImage string            `json:"badge_image,omitempty"`
	Image      string            `json:"image,omitempty"`
	Enlisted   string            `json:"enlisted,omitempty"`
	Location   map[string]string `json:"location,omitempty"`
	Fluency    []string          `json:"fluency,omitempty"`
	Website    string            `json:"website,omitempty"`
	Bio        string            `json:"bio,omitempty"`
}

ProfileInfo contains user profile details

type ProgressTracker

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

ProgressTracker fetches progress tracker teams

func NewProgressTracker

func NewProgressTracker(dateMin, dateMax string) *ProgressTracker

NewProgressTracker creates a new progress tracker fetcher

func (*ProgressTracker) Execute

func (p *ProgressTracker) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches teams data

type ProgressTrackerInfo

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

ProgressTrackerInfo fetches detailed progress tracker info for a specific team

func NewProgressTrackerInfo

func NewProgressTrackerInfo(slug, dateMin, dateMax string) *ProgressTrackerInfo

NewProgressTrackerInfo creates a new progress tracker info fetcher

func (*ProgressTrackerInfo) Execute

func (p *ProgressTrackerInfo) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches deliverables with disciplines

type Roadmap

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

Roadmap fetches roadmap data for Star Citizen or Squadron 42

func NewRoadmap

func NewRoadmap(board string, version string) *Roadmap

NewRoadmap creates a new Roadmap fetcher

func (*Roadmap) Execute

func (r *Roadmap) Execute(ctx context.Context) ([]RoadmapRelease, error)

Execute fetches and processes roadmap data

type RoadmapCard

type RoadmapCard struct {
	ID           int    `json:"id"`
	CategoryID   int    `json:"category_id"`
	CategoryName string `json:"category_name"`
	Name         string `json:"name"`
	Description  string `json:"description"`
}

RoadmapCard represents a single roadmap card

type RoadmapCategory

type RoadmapCategory struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

RoadmapCategory represents a category

type RoadmapRelease

type RoadmapRelease struct {
	ID          int           `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Cards       []RoadmapCard `json:"cards"`
}

RoadmapRelease represents a release containing multiple cards

type Ship

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

Ship fetches ship information with search and pagination

func NewShip

func NewShip(options map[string]any) *Ship

NewShip creates a new ship fetcher

func (*Ship) Execute

func (s *Ship) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches ships with concurrent detail fetching

type ShipData

type ShipData struct {
	ID    int     `json:"id"`
	Name  string  `json:"name"`
	URL   string  `json:"url"`
	Price float64 `json:"price"`
}

ShipData represents a single ship

type StarmapAffiliations

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

StarmapAffiliations fetches and filters starmap affiliations

func NewStarmapAffiliations

func NewStarmapAffiliations(name string) *StarmapAffiliations

NewStarmapAffiliations creates a new starmap affiliations fetcher

func (*StarmapAffiliations) Execute

func (a *StarmapAffiliations) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches affiliations data

type StarmapCelestialObjects

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

StarmapCelestialObjects fetches celestial object details by code

func NewStarmapCelestialObjects

func NewStarmapCelestialObjects(code string) *StarmapCelestialObjects

NewStarmapCelestialObjects creates a new celestial objects fetcher

func (*StarmapCelestialObjects) Execute

func (c *StarmapCelestialObjects) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches celestial object details

type StarmapRouteResult

type StarmapRouteResult struct {
	Shortest   any `json:"shortest"`
	LeastJumps any `json:"leastjumps"`
}

StarmapRouteResult contains route search results

type StarmapRouteSearch

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

StarmapRouteSearch finds routes between systems

func NewStarmapRouteSearch

func NewStarmapRouteSearch(from, to, shipSize string) *StarmapRouteSearch

NewStarmapRouteSearch creates a new route search shipSize: S, M, or L

func (*StarmapRouteSearch) Execute

Execute performs a route search

type StarmapSearch

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

StarmapSearch performs a starmap search

func NewStarmapSearch

func NewStarmapSearch(search string) *StarmapSearch

NewStarmapSearch creates a new starmap search

func (*StarmapSearch) Execute

Execute performs a starmap search

type StarmapSearchResult

type StarmapSearchResult struct {
	Systems []map[string]any `json:"systems"`
	Objects []map[string]any `json:"objects"`
}

StarmapSearchResult contains search results

type StarmapSpecies

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

StarmapSpecies fetches and filters starmap species

func NewStarmapSpecies

func NewStarmapSpecies(name string) *StarmapSpecies

NewStarmapSpecies creates a new starmap species fetcher

func (*StarmapSpecies) Execute

func (s *StarmapSpecies) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches species data

type StarmapStarSystems

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

StarmapStarSystems fetches star system details by code

func NewStarmapStarSystems

func NewStarmapStarSystems(code string) *StarmapStarSystems

NewStarmapStarSystems creates a new star systems fetcher

func (*StarmapStarSystems) Execute

func (s *StarmapStarSystems) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches star system details

type StarmapSystems

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

StarmapSystems fetches and filters starmap systems

func NewStarmapSystems

func NewStarmapSystems(name string) *StarmapSystems

NewStarmapSystems creates a new starmap systems fetcher

func (*StarmapSystems) Execute

func (s *StarmapSystems) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches systems data

type StarmapTunnels

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

StarmapTunnels fetches and filters starmap tunnels

func NewStarmapTunnels

func NewStarmapTunnels(tid string) *StarmapTunnels

NewStarmapTunnels creates a new starmap tunnels fetcher

func (*StarmapTunnels) Execute

func (t *StarmapTunnels) Execute(ctx context.Context) ([]map[string]any, error)

Execute fetches tunnels data

type Stats

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

Stats fetches general RSI statistics

func NewStats

func NewStats() *Stats

NewStats creates a new Stats fetcher

func (*Stats) Execute

func (s *Stats) Execute(ctx context.Context) (*StatsData, error)

Execute fetches statistics data

type StatsData

type StatsData struct {
	Fans        int     `json:"fans"`
	Funds       float64 `json:"funds"`
	Fleet       *int    `json:"fleet"` // Can be null
	CurrentLive *string `json:"current_live"`
	CurrentPTU  *string `json:"current_ptu"`
	CurrentETF  *string `json:"current_etf"`
}

StatsData represents RSI statistics

type Telemetry

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

Telemetry fetches telemetry data for Star Citizen

func NewTelemetry

func NewTelemetry(timetable, version string) *Telemetry

NewTelemetry creates a new Telemetry fetcher timetable: "DAY", "WEEK", or "MONTH" version: Star Citizen game version (e.g., "3.17.0")

func (*Telemetry) Execute

func (t *Telemetry) Execute(ctx context.Context) (map[string]any, error)

Execute fetches telemetry data

type TextContent

type TextContent struct {
	HTML      string `json:"html,omitempty"`
	Plaintext string `json:"plaintext,omitempty"`
}

TextContent contains HTML and plaintext versions

type User

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

User fetches RSI user/citizen information

func NewUser

func NewUser(userHandle string) *User

NewUser creates a new User fetcher

func (*User) Execute

func (u *User) Execute(ctx context.Context) (*UserProfile, error)

Execute fetches user profile information

type UserAffiliationInfo

type UserAffiliationInfo struct {
	SID   string `json:"sid,omitempty"`
	Name  string `json:"name,omitempty"`
	Rank  string `json:"rank,omitempty"`
	Stars int    `json:"stars"`
	Image string `json:"image,omitempty"`
}

UserAffiliationInfo represents an affiliated organization

type UserProfile

type UserProfile struct {
	Profile      ProfileInfo           `json:"profile"`
	Organization OrganizationInfo      `json:"organization"`
	Affiliation  []UserAffiliationInfo `json:"affiliation"`
}

UserProfile represents a user's profile information

type VersionInfo

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

VersionInfo fetches Star Citizen patch notes

func NewVersionInfo

func NewVersionInfo() *VersionInfo

NewVersionInfo creates a new VersionInfo fetcher

func (*VersionInfo) Execute

func (v *VersionInfo) Execute(ctx context.Context) ([]PatchNote, error)

Execute fetches patch notes

Jump to

Keyboard shortcuts

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