rsi

package module
v1.3.0 Latest Latest
Warning

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

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

README

GoScrapeRSI

Go Version 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
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:

go get github.com/koo04/GoScrapeRSI

Or add it to your go.mod:

require github.com/koo04/GoScrapeRSI v1.0.0

Then run:

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
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
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
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
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
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
// 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:

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 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")
	ErrForbidden       = errors.New("forbidden")
	ErrMaintenance     = errors.New("service under maintenance")
)

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 CategoryInfo added in v1.1.0

type CategoryInfo struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

CategoryInfo represents a deliverable category

type CelestialObjectInfo added in v1.1.0

type CelestialObjectInfo struct {
	ID                string         `json:"id"`
	Code              string         `json:"code"`
	Name              string         `json:"name"`
	Type              string         `json:"type"`
	Designation       string         `json:"designation"`
	Description       string         `json:"description"`
	Size              string         `json:"size"`
	Danger            int            `json:"danger"`
	Economy           int            `json:"economy"`
	Population        int            `json:"population"`
	Fairchanceact     bool           `json:"fairchanceact"`
	Habitable         int            `json:"habitable"`
	SensorPopulation  int            `json:"sensor_population"`
	SensorEconomy     int            `json:"sensor_economy"`
	SensorDanger      int            `json:"sensor_danger"`
	AffiliationID     string         `json:"affiliation_id"`
	AffiliationName   string         `json:"affiliation_name"`
	AxialTilt         float64        `json:"axial_tilt,omitempty"`
	Latitude          float64        `json:"latitude,omitempty"`
	Longitude         float64        `json:"longitude,omitempty"`
	ArrivalPoint      int            `json:"arrival_point,omitempty"`
	TimestampAdded    string         `json:"time_added"`
	TimestampModified string         `json:"time_modified"`
	Thumbnail         Thumbnail      `json:"thumbnail"`
	SubType           []SubType      `json:"subtype"`
	AggregatedSize    string         `json:"aggregated_size,omitempty"`
	AggregatedDanger  string         `json:"aggregated_danger,omitempty"`
	Raw               map[string]any `json:"-"`
}

CelestialObjectInfo represents a celestial object within a system

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) ([]DeliverableInfo, error)

GetProgressTrackerInfo fetches detailed progress tracker info for a team

func (*Client) GetProgressTrackerTeams

func (c *Client) GetProgressTrackerTeams(ctx context.Context, dateMin, dateMax string) ([]ProgressTrackerTeam, 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) ([]StarmapAffiliationData, error)

GetStarmapAffiliations fetches starmap affiliations, optionally filtered by name or code

func (*Client) GetStarmapCelestialObject

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

GetStarmapCelestialObject fetches celestial object details by code

func (*Client) GetStarmapSpecies

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

GetStarmapSpecies fetches starmap species, optionally filtered by name or code

func (*Client) GetStarmapStarSystem

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

GetStarmapStarSystem fetches star system details by code

func (*Client) GetStarmapSystems

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

GetStarmapSystems fetches starmap systems, optionally filtered by name

func (*Client) GetStarmapTunnels

func (c *Client) GetStarmapTunnels(ctx context.Context, tid string) ([]StarmapTunnel, 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) 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) ([]ShipData, 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 DeliverableInfo added in v1.1.0

type DeliverableInfo struct {
	UUID                string           `json:"uuid"`
	Slug                string           `json:"slug"`
	Title               string           `json:"title"`
	Description         string           `json:"description"`
	Category            CategoryInfo     `json:"category"`
	StartDate           string           `json:"startDate"`
	EndDate             string           `json:"endDate"`
	UpdateDate          string           `json:"updateDate"`
	NumberOfDisciplines int              `json:"numberOfDisciplines"`
	Thumbnail           string           `json:"thumbnail"`
	Disciplines         []DisciplineInfo `json:"disciplines,omitempty"`
	Raw                 map[string]any   `json:"-"`
}

DeliverableInfo represents a deliverable in progress tracker

type DisciplineInfo added in v1.1.0

type DisciplineInfo struct {
	UUID      string         `json:"uuid"`
	Title     string         `json:"title"`
	StartDate string         `json:"startDate"`
	EndDate   string         `json:"endDate"`
	Thumbnail string         `json:"thumbnail"`
	Raw       map[string]any `json:"-"`
}

DisciplineInfo represents a discipline working on a deliverable

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 Position added in v1.1.0

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z"`
}

Position represents 3D coordinates

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

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

Execute fetches deliverables with disciplines

type ProgressTrackerTeam added in v1.1.0

type ProgressTrackerTeam struct {
	UUID            string           `json:"uuid"`
	Title           string           `json:"title"`
	Description     string           `json:"description"`
	Abbreviation    string           `json:"abbreviation"`
	Thumbnail       string           `json:"thumbnail"`
	StartDate       string           `json:"startDate"`
	EndDate         string           `json:"endDate"`
	NumberOfMembers int              `json:"numberOfMembers"`
	TimeAllocations []TimeAllocation `json:"timeAllocations"`
	Raw             map[string]any   `json:"-"`
}

ProgressTrackerTeam represents a team in the progress tracker

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) ([]ShipData, 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,omitempty"`
	ChassisID        int     `json:"chassis_id,omitempty"`
	ManufacturerID   int     `json:"manufacturer_id,omitempty"`
	ManufacturerCode string  `json:"manufacturer_code,omitempty"`
	ManufacturerName string  `json:"manufacturer_name,omitempty"`
	Classification   string  `json:"type,omitempty"`
	Focus            string  `json:"focus,omitempty"`
	Length           float64 `json:"length,omitempty"`
	Beam             float64 `json:"beam,omitempty"`
	Height           float64 `json:"height,omitempty"`
	Mass             float64 `json:"mass,omitempty"`
	Cargo            float64 `json:"cargo,omitempty"`
	MinCrew          int     `json:"min_crew,omitempty"`
	MaxCrew          int     `json:"max_crew,omitempty"`
	ProductionStatus string  `json:"production_status,omitempty"`
	StoreURL         string  `json:"store_url,omitempty"`
	// Raw data for any additional fields not mapped
	Raw map[string]any `json:"-"`
}

ShipData represents a single ship with all its properties

type StarmapAffiliationData added in v1.1.0

type StarmapAffiliationData struct {
	ID                string         `json:"id"`
	Code              string         `json:"code"`
	Name              string         `json:"name"`
	Color             string         `json:"color"`
	Membership        int            `json:"membership_id"`
	TimestampAdded    string         `json:"time_added"`
	TimestampModified string         `json:"time_modified"`
	Raw               map[string]any `json:"-"`
}

StarmapAffiliationData represents a political affiliation or faction

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

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

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) ([]StarmapSpeciesData, error)

Execute fetches species data

type StarmapSpeciesData added in v1.1.0

type StarmapSpeciesData struct {
	ID                string         `json:"id"`
	Code              string         `json:"code"`
	Name              string         `json:"name"`
	Description       string         `json:"description"`
	TimestampAdded    string         `json:"time_added"`
	TimestampModified string         `json:"time_modified"`
	Raw               map[string]any `json:"-"`
}

StarmapSpeciesData represents a species in the Star Citizen universe

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) ([]StarmapSystem, error)

Execute fetches star system details

type StarmapSystem added in v1.1.0

type StarmapSystem struct {
	ID                string                `json:"id"`
	Code              string                `json:"code"`
	Name              string                `json:"name"`
	Type              string                `json:"type"`
	Position          Position              `json:"position"`
	Frost             string                `json:"frost_line"`
	AggregatedSize    string                `json:"aggregated_size"`
	AggregatedDanger  string                `json:"aggregated_danger"`
	AffiliationID     string                `json:"affiliation_id"`
	AffiliationName   string                `json:"affiliation_name"`
	Description       string                `json:"description"`
	Status            string                `json:"status"`
	TimestampAdded    string                `json:"time_added"`
	TimestampModified string                `json:"time_modified"`
	Thumbnail         Thumbnail             `json:"thumbnail"`
	Celestial         []CelestialObjectInfo `json:"celestial_objects"`
	Raw               map[string]any        `json:"-"`
}

StarmapSystem represents a star system in the starmap

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) ([]StarmapSystem, error)

Execute fetches systems data

type StarmapTunnel added in v1.1.0

type StarmapTunnel struct {
	ID                string         `json:"id"`
	Name              string         `json:"name"`
	Status            string         `json:"status"`
	Entry             TunnelPoint    `json:"entry"`
	Exit              TunnelPoint    `json:"exit"`
	Direction         string         `json:"direction"`
	Size              string         `json:"size"`
	TimestampAdded    string         `json:"time_added"`
	TimestampModified string         `json:"time_modified"`
	Raw               map[string]any `json:"-"`
}

StarmapTunnel represents a jump tunnel between systems

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) ([]StarmapTunnel, 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 SubType added in v1.1.0

type SubType struct {
	ID   string `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
}

SubType represents object subtype information

type TextContent

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

TextContent contains HTML and plaintext versions

type Thumbnail added in v1.1.0

type Thumbnail struct {
	Source string `json:"source"`
	Tags   string `json:"tags"`
}

Thumbnail represents image information

type TimeAllocation added in v1.1.0

type TimeAllocation struct {
	UUID             string          `json:"uuid"`
	StartDate        string          `json:"startDate"`
	EndDate          string          `json:"endDate"`
	PartialTime      int             `json:"partialTime"`
	TotalDays        int             `json:"totalDays"`
	TotalWorkingDays int             `json:"totalWorkingDays"`
	Deliverable      DeliverableInfo `json:"deliverable"`
	Raw              map[string]any  `json:"-"`
}

TimeAllocation represents time allocation for a team

type TunnelPoint added in v1.1.0

type TunnelPoint struct {
	StarSystemID   string `json:"star_system_id"`
	StarSystemName string `json:"star_system_name"`
	CelestialID    string `json:"celestial_object_id,omitempty"`
	CelestialName  string `json:"celestial_object_name,omitempty"`
}

TunnelPoint represents entry or exit point of a tunnel

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 {
	Info         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

Directories

Path Synopsis
examples
basic command

Jump to

Keyboard shortcuts

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